I installed apache httpd on my linux vm and wanted to start it's service. BUt I'm getting error (13)Permission denied. Error retrieving pid file run/httpd.pid
(13)Permission denied. Error retrieving pid file run/httpd.pid
I realised that I do not have this file. Not even a var directory. Any solutions for this? Pardon me, this is my first time touching servers.
I installed the apache like this:
gzip -d httpd-2.2.21.tar.gz
tar xvf httpd-2.2.21.tar
./configure --prefix=/home/Hend/Desktop/Server
make
make install
You have several alternatives for this:
This is the way you started doing that. But then you'll have to:
DocumentRoot
somewhere else thant /var/www
8000
instead of 80
. But this way, all your URLs will look like http://example.com:8000
instead of http://example.com
. /usr/local
You can install apache in the default path for non-part-of-distro stuff, that is /usr/local
instead of /usr/
. That is, use --prefix=/usr/local/
when running configure
. This way, things should be much simpler. In any case, you'll have to run the webserver from root, and configure it to change user only after socket is opened.
/usr/
You can also install apache in its default location, usint --prefix=/usr/
. This way things should be much simpler, it should install init scripts in the usual location /etc/init.d/apache2
or /etc/init.d/httpd
, configuration in /etc/apache2
etc. Beware that doing this all the apache installed files will conflict with the ones of the version provided by your linux distribution!
A part from the case in which you want particular setups (for example with non-standard patches), particular non-packaged versions (not recommended, since usually versions packaged with distros are guaranteed to be stable, others are not).
Benefits of doing this:
For example, on debian:
apt-get install apache2
On fedora:
yum install httpd
etc.
Then, if the service is not already started by package manager, you can start it with
/etc/init.d/apache2 start
or
/etc/init.d/httpd start
Job done. Now just put stuff in /var/www/
(or equivalent directory, depends on distro) and see it through you web server.
You have to start apache as root
Have you read the docs in the source distribution?
ie INSTALL
less INSTALL
For complete installation documentation, see [ht]docs/manual/install.html or
http://httpd.apache.org/docs/2.2/install.html
$ ./configure --prefix=PREFIX
$ make
$ make install
$ PREFIX/bin/apachectl start
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.