Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
got in an apache2 mess - need help walking through pls
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Thu Apr 10, 2008 3:17 am    Post subject: got in an apache2 mess - need help walking through pls Reply with quote

Hi apache gurus :)

I have been following wiki and forum threads to unmuddle my apache2 setup and find I am confused about where I am going wrong:

I need some clarifications and pointers to help me see the light.

My machine is called "mythology" and I have a dyndns ip setup on my router which gets my wan dhcp address.

My router is setup to put mythology in the DMZ and so far I am always able to get to

mydyndns.homelinux.org:22

so far so good; I am able to reliably get terminal sessions to my box in the dmz.

Now I want mythweb and phpMyAdmin etc available from port 8000 so I did the apache2 emerge
.
At first I was having apache2 complain about resolving the local host name and fqdn

Code:
mythology ~ # /etc/init.d/apache2 start
 * Starting apache2 ...
apache2: apr_sockaddr_info_get() failed for mythology.mydyndns.homelinux.org
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName


but after modifying my /etc/conf.d/hostname and domainname I find that apache2 can start:

Code:
mythology apache2 # cat /etc/conf.d/hostname
# /etc/conf.d/hostname

# Set to the hostname of this machine
HOSTNAME="mythology.mydyndns.homelinux.org"
mythology apache2 # cat /etc/conf.d/domainname
OVERRIDE=1
DNSDOMAIN="mydyndns.homelinux.org"
mythology apache2 #


Code:
mythology apache2 # /etc/init.d/apache2 start
 * Starting apache2 ...                                                                                                                                             [ !! ]
mythology apache2 # /etc/init.d/apache2 status
 * status:  stopped
mythology apache2 #


So I began working on my available config files and find that I am confused about which ones are being used. There is:

/etc/conf.d/apache2

and /etc/apache2/httpd.conf

and potentially the virtual host defined in vhotsts.d (since the virtual host module is automatically started.

so here is what I have in each of those in an attempt to get my box on the air on port 8000

Code:
mythology conf.d # cat apache2
# /etc/conf.d/apache2: config file for /etc/init.d/apache2

# When you install a module it is easy to activate or deactivate the modules
# and other features of apache using the APACHE2_OPTS line. Every module should
# install a configuration in /etc/apache2/modules.d. In that file will have an
# <IfDefine NNN> directive where NNN is the option to enable that module.
#
# Here are the options available in the default configuration:
#
#  AUTH_DIGEST  Enables mod_auth_digest
#  AUTHNZ_LDAP  Enables authentication through mod_ldap (available if USE=ldap)
#  CACHE        Enables mod_cache
#  DAV          Enables mod_dav
#  ERRORDOCS    Enables default error documents for many languages.
#  INFO         Enables mod_info, a useful module for debugging
#  LANGUAGE     Enables content-negotiation based on language and charset.
#  LDAP         Enables mod_ldap (available if USE=ldap)
#  MANUAL       Enables /manual/ to be the apache manual (available if USE=docs)
#  MEM_CACHE    Enables default configuration mod_mem_cache
#  PROXY        Enables mod_proxy
#  SSL          Enables SSL (available if USE=ssl)
#  SUEXEC       Enables running CGI scripts (in USERDIR) through suexec.
#  USERDIR      Enables /~username mapping to /home/username/public_html
#
#
# The following two options provide the default virtual host for the HTTP and
# HTTPS protocol. YOU NEED TO ENABLE AT LEAST ONE OF THEM, otherwise apache
# will not listen for incomming connections on the approriate port.
#
#  DEFAULT_VHOST      Enables name-based virtual hosts, with the default
#                     virtual host being in /var/www/localhost/htdocs
#  SSL_DEFAULT_VHOST  Enables default vhost for SSL (you should enable this
#                     when you enable SSL)
#
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST"

# Extended options for advanced uses of Apache ONLY
# You don't need to edit these unless you are doing crazy Apache stuff
# As not having them set correctly, or feeding in an incorrect configuration
# via them will result in Apache failing to start
# YOU HAVE BEEN WARNED.

# ServerRoot setting
SERVERROOT=/usr/lib/apache2

# Configuration file location
# - If this does NOT start with a '/', then it is treated relative to
# $SERVERROOT by Apache
CONFIGFILE=/etc/apache2/httpd.conf

# Location to log startup errors to
# They are normally dumped to your terminal.
#STARTUPERRORLOG="/var/log/apache2/startuperror.log"

# A command that outputs a formatted text version of the HTML at the URL
# of the command line. Designed for lynx, however other programs may work.
#LYNX="lynx -dump"

# The URL to your server's mod_status status page.
# Required for status and fullstatus
STATUSURL="http://localhost/server-status"

# Method to use when reloading the server
# Valid options are 'restart' and 'graceful'
# See http://httpd.apache.org/docs/2.2/stopping.html for information on
# what they do and how they differ.
RELOAD_TYPE="graceful"

In the above I uncommented the line that points to httpd;.conf as the config file since I had already edited it thus:

Code:
mythology apache2 # cat /etc/apache2/httpd.conf
# This is a modification of the default Apache 2.2 configuration file
# for Gentoo Linux.
#
# Support:
#   http://www.gentoo.org/main/en/lists.xml   [mailing lists]
#   http://forums.gentoo.org/                 [web forums]
#   irc://irc.freenode.net#gentoo-apache      [irc chat]
#
# Bug Reports:
#   http://bugs.gentoo.org                    [gentoo related bugs]
#   http://httpd.apache.org/bug_report.html   [apache httpd related bugs]
#
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "var/log/apache2/foo_log"
# with ServerRoot set to "/usr" will be interpreted by the
# server as "/usr/var/log/apache2/foo.log".

# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk.  If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
ServerRoot "/usr/lib/apache2"
ServerName mythology.mydyndns.homelinux.org:8000
Listen 8000
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
# GENTOO: Automatically defined based on APACHE2_MODULES USE_EXPAND variable.
#         Do not change manually, it will be overwritten on upgrade.
#
# The following modules are considered as the default configuration.
# If you wish to disable one of them, you may have to alter other
# configuration directives.
#
# Change these at your own risk!

LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
<IfDefine AUTHNZ_LDAP>
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
</IfDefine>
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
<IfDefine CACHE>
LoadModule cache_module modules/mod_cache.so
</IfDefine>
LoadModule cgid_module modules/mod_cgid.so
<IfDefine DAV>
LoadModule dav_module modules/mod_dav.so
</IfDefine>
<IfDefine DAV>
LoadModule dav_fs_module modules/mod_dav_fs.so
</IfDefine>
<IfDefine DAV>
LoadModule dav_lock_module modules/mod_dav_lock.so
</IfDefine>
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
<IfDefine CACHE>
LoadModule disk_cache_module modules/mod_disk_cache.so
</IfDefine>
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule ext_filter_module modules/mod_ext_filter.so
<IfDefine CACHE>
LoadModule file_cache_module modules/mod_file_cache.so
</IfDefine>
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
<IfDefine INFO>
LoadModule info_module modules/mod_info.so
</IfDefine>
<IfDefine LDAP>
LoadModule ldap_module modules/mod_ldap.so
</IfDefine>
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
<IfDefine CACHE>
LoadModule mem_cache_module modules/mod_mem_cache.so
</IfDefine>
LoadModule mime_module modules/mod_mime.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule speling_module modules/mod_speling.so
<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
<IfDefine STATUS>
LoadModule status_module modules/mod_status.so
</IfDefine>
LoadModule unique_id_module modules/mod_unique_id.so
<IfDefine USERDIR>
LoadModule userdir_module modules/mod_userdir.so
</IfDefine>
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so

# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
User apache
Group apache

# Supplemental configuration
#
# Most of the configuration files in the /etc/apache2/modules.d/ directory can
# be turned on using APACHE2_OPTS in /etc/conf.d/apache2 to add extra features
# or to modify the default configuration of the server.
#
# To know which flag to add to APACHE2_OPTS, look at the first line of the
# the file, which will usually be an <IfDefine OPTION> where OPTION is the
# flag to use.
Include /etc/apache2/modules.d/*.conf

# Virtual-host support
#
# Gentoo has made using virtual-hosts easy. In /etc/apache2/vhosts.d/ we
# include a default vhost (enabled by adding -D DEFAULT_VHOST to
# APACHE2_OPTS in /etc/conf.d/apache2).
Include /etc/apache2/vhosts.d/*.conf

# vim: ts=4 filetype=apache


Not the attempt to ge the server name correct and handle the listening port.

unfortunately it seems that I have bigger fish to fry since the apache error log shows:

Code:

mythology apache2 # cat /var/log/apache2/error_log
[Thu Apr 10 11:58:45 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology"
Configuration Failed
[Thu Apr 10 11:59:48 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology"
Configuration Failed
[Thu Apr 10 12:00:29 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology"
Configuration Failed
[Thu Apr 10 12:03:09 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology"
Configuration Failed
[Thu Apr 10 12:03:58 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 12:06:55 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 12:23:11 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 12:27:22 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 12:29:23 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 12:32:17 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 12:46:29 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 12:47:51 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 12:50:25 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 13:01:27 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed
[Thu Apr 10 13:09:26 2008] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "mythology.mydyndns.homelinux.org"
Configuration Failed


Basically I started with a default gentoo emerge and now have fooled around a bit too much to be thinking I am making any progress.

I do run shorewall but have checked that it is not to blame -

Code:
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:8000


can someone please parse the above and walk me through the setup?

TIA
Will
_________________
]8P
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Thu Apr 10, 2008 5:07 am    Post subject: Reply with quote

turned out to be a simple hostname problem

I edited hosts to be only:

Code:

# IPv4 and IPv6 localhost aliases
127.0.0.1   localhost mythology
192.168.0.100   mythology.mydyndns.homelinux.org
192.168.0.1    skink


and restarted apache - IT WORKS :)
_________________
]8P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum