[英]Missing var directory after Apache httpd installation
我在我的linux vm上安装了apache httpd,并希望启动它的服务。 BUt我收到错误(13)Permission denied. Error retrieving pid file run/httpd.pid
(13)Permission denied. Error retrieving pid file run/httpd.pid
我意识到我没有这个文件。 甚至不是var目录。 对此有何解决方案? 请原谅,这是我第一次接触服务器。
我像这样安装了apache:
gzip -d httpd-2.2.21.tar.gz
tar xvf httpd-2.2.21.tar
./configure --prefix=/home/Hend/Desktop/Server
make
make install
你有几种选择:
这是你开始这样做的方式。 但是你必须:
DocumentRoot
放在/var/www
8000
而不是80
。 但是这样,您的所有网址都会显示为http://example.com:8000
而不是http://example.com
。 /usr/local
您可以在非分区发布内容的默认路径中安装apache,即/usr/local
而不是/usr/
。 也就是说,在运行configure
时使用--prefix=/usr/local/
。 这样,事情应该简单得多。 在任何情况下,您都必须从root运行Web服务器,并将其配置为仅在打开套接字后更改用户。
/usr/
您还可以在其默认位置usint --prefix=/usr/
安装apache。 这样事情应该简单得多,它应该在通常的位置/etc/init.d/apache2
或/etc/init.d/httpd
/etc/apache2
配置/etc/apache2
安装init脚本。请注意这样做所有的apache安装的文件将与您的Linux发行版提供的版本冲突!
您需要特定设置(例如非标准补丁)的情况下的部分,特别是非打包版本(不推荐,因为通常与发行版打包的版本保证稳定,而其他版本不保证)。
这样做的好处:
例如,在debian上:
apt-get install apache2
关于fedora:
yum install httpd
等等
然后,如果包管理器尚未启动该服务,则可以启动它
/etc/init.d/apache2 start
要么
/etc/init.d/httpd start
任务完成。 现在只需将内容放入/var/www/
(或等效目录,取决于发行版)并通过您的Web服务器查看。
你必须以root身份启动apache
您是否阅读过源代码分发中的文档?
即安装
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.