安装设置Apache+PHP
Tofloor
poster avatar
海天鹰
deepin
2016-04-25 20:05
Author
本帖最后由 sonichy 于 2016-4-25 12:39 编辑

终端,sudo su,密码,进入管理员身份。
apt-get install apache2
apt-get install php5
/etc/apache2/sites-available/000-default.conf中的DocumentRoot默认为/var/www/html,修改成自己的文件夹(好像中文目录或者是非host分区会没有访问权限)。
修改目录权限,/etc/apache2/apache2.conf:

        Options Indexes FollowSymLinks
        AllowOverride None
        #Require all denied
        allow from all


重启:apache2 -k restart
报错:
Config variable ${APACHE_LOCK_DIR} is not defined
Config variable ${APACHE_PID_FILE} is not defined
Config variable ${APACHE_RUN_USER} is not defined
Config variable ${APACHE_RUN_GROUP} is not defined
Config variable ${APACHE_LOG_DIR} is not defined
Config variable ${APACHE_LOG_DIR} is not defined
Config variable ${APACHE_LOG_DIR} is not defined
Config variable ${APACHE_LOG_DIR} is not defined
Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file{APACHE_LOCK_DIR}
运行:source /etc/apache2/envvars
查看:apache2 -V


局域网访问,/etc/apache2/sites-available/000-default.conf中的VirtualHost和ServerName改为本机IP,wifi手机也可以访问:

ServerName 192.168.2.101
......

重启警告:
Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
没有成功解决。

Reply Favorite View the author
All Replies
avatar
fythocn
deepin
2016-04-26 00:28
#1
Nginx+PHP欢迎入坑
Reply View the author