Apache Web Server
#1
Scooby Regular
Thread Starter
Join Date: Nov 1998
Posts: 11,905
Likes: 0
Received 0 Likes
on
0 Posts
Hello
Does anyone know anything about Apache on Solaris?
I naively assumed that if I copied the apache directory to another place, changed httpd.conf then everything would work fine. But it appears to have a hard coded reference somewhere to the original directory.
Any suggestions?
Thanks,
Steve.
Does anyone know anything about Apache on Solaris?
I naively assumed that if I copied the apache directory to another place, changed httpd.conf then everything would work fine. But it appears to have a hard coded reference somewhere to the original directory.
Any suggestions?
Thanks,
Steve.
#2
Scooby Regular
Join Date: Sep 2001
Location: Kingston ( Surrey, not Jamaica )
Posts: 4,670
Likes: 0
Received 0 Likes
on
0 Posts
Should just be a copy over. Where are you getting the problem - on startup or in operation ? have you checked the apachectl script for amended paths etc ?
We generally install to /path/apache-version and symlink back to /path/apache .
Steve
We generally install to /path/apache-version and symlink back to /path/apache .
Steve
#4
Scooby Regular
Thread Starter
Join Date: Nov 1998
Posts: 11,905
Likes: 0
Received 0 Likes
on
0 Posts
Hello
Thanks for your replies.
apachectl points to the correct directory, I get the error when I am trying to start up apache. The error_log file is pointing to the old directory. To which this user (obviously) doesn't have permission.
-=-=-=
I get the error:
fopen: Permission denied
httpd: could not open error log file /olddirectory/error_log.
apachectl start: httpd could not be started
-=-=-=
Steve.
Thanks for your replies.
apachectl points to the correct directory, I get the error when I am trying to start up apache. The error_log file is pointing to the old directory. To which this user (obviously) doesn't have permission.
-=-=-=
I get the error:
fopen: Permission denied
httpd: could not open error log file /olddirectory/error_log.
apachectl start: httpd could not be started
-=-=-=
Steve.
Trending Topics
#8
Scooby Regular
Have you made the modifications to the httpd.conf and made sure Apache is using the right config file? You can see the hard-coded locations by running 'httpd -V', look for the SERVER_CONFIG_FILE line. You can point Apache to another config file with 'httpd -f /path/to/httpd.conf'
#9
Scooby Regular
Thread Starter
Join Date: Nov 1998
Posts: 11,905
Likes: 0
Received 0 Likes
on
0 Posts
Hello
Again, thanks for the replies.
Having run httpd -V, the problem is that HTTPD_ROOT points to the old apache installation directory. How can I change this? It appears to be compiled in?
Thanks,
Steve.
Again, thanks for the replies.
Having run httpd -V, the problem is that HTTPD_ROOT points to the old apache installation directory. How can I change this? It appears to be compiled in?
Thanks,
Steve.
#14
Scooby Regular
Join Date: Sep 2001
Location: Kingston ( Surrey, not Jamaica )
Posts: 4,670
Likes: 0
Received 0 Likes
on
0 Posts
#15
Scooby Regular
Sorry, it _can_ be done You do not need to recompile Apache just to change the location of the executable and configuration
Edit: here's how!
You're probably using apachectl to start/stop Apache - apachectl is purely a wrapper around the httpd binary. That's what's in your rc.whatever directory right? You just need to change that to use httpd instead of apachectl. You can start just by running the httpd with command line parameters to the new location of the httpd.conf ('httpd -f /path/to/httpd.conf'), and inside there you specify your ServerRoot et al so no need to put anything else on the command line.
Your location to httpd.pid may be different:
'apachectl start' is the same as '/usr/local/wherever/httpd -f /path/to/new/httpd.conf'
'apachectl startssl' is the same as 'httpd -D SSL' or, to include the new location of the httpd.conf, 'httpd -f /path/to/new/httpd.conf -D SSL'
'apachectl stop' is the same as 'kill `cat /var/run/httpd.pid`'
'apachectl configtest' is equivalent to 'httpd -f /path/to/new/httpd.conf -t'.
'apachectl graceful' is the same as 'kill -USR1 `cat /var/run/httpd.pid`'
'apachectl restart' is the same as 'kill -HUP `cat /var/run/httpd.pid`'
It's as simple as that
Steve.
[Edited by stevencotton - 12/5/2003 11:22:00 AM]
Edit: here's how!
You're probably using apachectl to start/stop Apache - apachectl is purely a wrapper around the httpd binary. That's what's in your rc.whatever directory right? You just need to change that to use httpd instead of apachectl. You can start just by running the httpd with command line parameters to the new location of the httpd.conf ('httpd -f /path/to/httpd.conf'), and inside there you specify your ServerRoot et al so no need to put anything else on the command line.
Your location to httpd.pid may be different:
'apachectl start' is the same as '/usr/local/wherever/httpd -f /path/to/new/httpd.conf'
'apachectl startssl' is the same as 'httpd -D SSL' or, to include the new location of the httpd.conf, 'httpd -f /path/to/new/httpd.conf -D SSL'
'apachectl stop' is the same as 'kill `cat /var/run/httpd.pid`'
'apachectl configtest' is equivalent to 'httpd -f /path/to/new/httpd.conf -t'.
'apachectl graceful' is the same as 'kill -USR1 `cat /var/run/httpd.pid`'
'apachectl restart' is the same as 'kill -HUP `cat /var/run/httpd.pid`'
It's as simple as that
Steve.
[Edited by stevencotton - 12/5/2003 11:22:00 AM]
#16
Scooby Regular
Thread Starter
Join Date: Nov 1998
Posts: 11,905
Likes: 0
Received 0 Likes
on
0 Posts
Okay Mr. Cotton,
How?!
Here are my compiled in variables:
-=-=-
httpd -V
Server compiled with....
-D HAVE_MMAP
-D USE_MMAP_SCOREBOARD
-D USE_MMAP_FILES
-D USE_FCNTL_SERIALIZED_ACCEPT
-D HTTPD_ROOT="/bvu/bvportal/apache"
-D SUEXEC_BIN="/bvu/bvportal/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/httpd.scoreboard"
-D DEFAULT_LOCKFILE="logs/httpd.lock"
-D DEFAULT_XFERLOG="logs/access_log"
-D DEFAULT_ERRORLOG="logs/error_log"
-D TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
-D ACCESS_CONFIG_FILE="conf/access.conf"
-D RESOURCE_CONFIG_FILE="conf/srm.conf"
-=-=-
So the problem is that when I try to start Apache, it is trying to open the log file in the wrong location.
Steve.
How?!
Here are my compiled in variables:
-=-=-
httpd -V
Server compiled with....
-D HAVE_MMAP
-D USE_MMAP_SCOREBOARD
-D USE_MMAP_FILES
-D USE_FCNTL_SERIALIZED_ACCEPT
-D HTTPD_ROOT="/bvu/bvportal/apache"
-D SUEXEC_BIN="/bvu/bvportal/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/httpd.scoreboard"
-D DEFAULT_LOCKFILE="logs/httpd.lock"
-D DEFAULT_XFERLOG="logs/access_log"
-D DEFAULT_ERRORLOG="logs/error_log"
-D TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
-D ACCESS_CONFIG_FILE="conf/access.conf"
-D RESOURCE_CONFIG_FILE="conf/srm.conf"
-=-=-
So the problem is that when I try to start Apache, it is trying to open the log file in the wrong location.
Steve.
#17
Scooby Regular
Yup - your problem is apachectl is using the defaults. Bypass apachectl and make calls to httpd directly instead, passing your new httpd.conf location. If you want to, write a script called apachectl which wrappers httpd so you can still use it using the template in my post above.
#18
Scooby Regular
Thread Starter
Join Date: Nov 1998
Posts: 11,905
Likes: 0
Received 0 Likes
on
0 Posts
Hello
Okay, that worked:
httpd -f /mydir/conf/httpd.conf -d /mydir
Although I can only do this as root, as I want it to bind to port 80.
Thanks for your help.
Steve.
Okay, that worked:
httpd -f /mydir/conf/httpd.conf -d /mydir
Although I can only do this as root, as I want it to bind to port 80.
Thanks for your help.
Steve.
Thread
Thread Starter
Forum
Replies
Last Post
Scott@ScoobySpares
Full Cars Breaking For Spares
55
05 August 2018 07:02 AM
oilman
Trader Announcements
15
01 October 2015 11:55 AM