虽然本教程为ubuntu操作系统,还是奉劝看到本教程的同学如果现在能更换成centos还是别使用ubuntu做服务器。
因历史原因我是暂时改不了了。
1、首先打开apache商品配置文件
/etc/apache2/ports.conf
添加监听端口
2、复制配置文件并修改
cp /etc/apache2/sites-available/000-default.conf *.conf
修改复制文件的端口号和默认路径
3、在apache2/sites-enabled中建立上面文件的软件连接。
ln -s /etc/apache2/sites-available/*.conf /etc/apache2/sites-enabled/*.conf
4、使配置文件生效
a2ensite *.conf
5、重启apache2
sudo /etc/init.d/apache2 restart
6、配置nginx转发到端口号(略)
注:另外还需要修改一下apach2.conf中
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all #允许所有访问
#Require all denied #这个要注掉可以使用所有目录
</Directory>