Apache: Changing path to httpd.conf -
a few months ago installed apache on mac osx 10.6.8. apache automatically installed @ /usr/local/apache2. after hiccups got apache listen on port 8080, , able apache execute cgi scripts out of /usr/local/apache2/cgi-bin.
i haven't used apache since then, , when fired apache using:
/usr/local/apache2/bin$ sudo apachectl -k start
and entered following url in browser:
http://localhost:8080
apache wouldn't serve index.html page or other page in /usr/local/apache2/htdocs. however, if used url:
http://localhost
then apache did serve "an index.html" page displayed, "it works". checked httpd.conf file located @ /usr/local/apache2/conf/httpd.conf, , apache set listen on port 8080:
listen 8080
next, changed file /usr/local/apache2/htdocs/index.html display, "hello world", apache still served page said "it works" when used url:
http://localhost
i checked httpd.conf file again line:
documentroot "/usr/local/apache2/htdocs"
so concluded apache install not using httpd.conf file located @ /usr/local/apache2/conf/httpd.conf. did searching google, , found command:
/usr/local/apache2/bin$ apachectl -v
which produced output:
server version: apache/2.2.22 (unix) server built: jul 12 2012 15:09:37 server's module magic number: 20051115:30 server loaded: apr 1.3.8, apr-util 1.3.9 compiled using: apr 1.3.8, apr-util 1.3.9 architecture: 64-bit server mpm: prefork threaded: no forked: yes (variable process count) server compiled with.... -d apache_mpm_dir="server/mpm/prefork" -d apr_has_sendfile -d apr_has_mmap -d apr_have_ipv6 (ipv4-mapped addresses enabled) -d apr_use_flock_serialize -d apr_use_pthread_serialize -d single_listen_unserialized_accept -d apr_has_other_child -d ap_have_reliable_piped_logs -d dynamic_module_limit=128 -d httpd_root="/usr" -d suexec_bin="/usr/bin/suexec" -d default_pidlog="/private/var/run/httpd.pid" -d default_scoreboard="logs/apache_runtime_status" -d default_lockfile="/private/var/run/accept.lock" -d default_errorlog="logs/error_log" -d ap_types_config_file="/private/etc/apache2/mime.types" -d server_config_file="/private/etc/apache2/httpd.conf"
the httpd.conf apache install using located @ /private/etc/apache2/httpd.conf, contains these lines:
serverroot "/usr" listen 80 documentroot "/library/webserver/documents"
my question is: how in hell did changes occur? apache docs path httpd.conf set @ compile time. considered possibility /usr/local/apache2/bin/apachectl might sym linked system apache, output:
/usr/local/apache2/bin$ ls -al total 2104 drwxr-xr-x 20 root admin 680 feb 19 12:36 . drwxr-xr-x 15 root admin 510 feb 19 12:36 .. -rwxr-xr-x 1 root admin 57200 feb 19 12:36 ab -rwxr-xr-x 1 7stud staff 3410 feb 19 12:32 apachectl
doesn't indicate case.
which
shows you're running system apachectl
instead of custom one. try
sudo /usr/local/apache2/bin/apachectl -k start
...to run yours , start own custom apache.
Comments
Post a Comment