安装好lamp环境之后,需要配置一下httpd
首先要改动的就是你远程连接服务器的端口设置,防止暴力破解,远程登录了你的服务器,那就惨了
/etc/ssh/sshd_config
打开这个文件,搜索“Port”,如果你是第一次操作的话,可以给两个端口把默认的端口Port 22 前边的 # 去掉,在多补一句Port 自己的端口号,防止设置不正确的话,22还可以使用,修改之后保存文件,重启服务器即可
/etc/httpd/conf/httpd.conf
按照路径打开httpd的配置文件,查看一下有没有重定向的相关配置文件(阿里云的服务器是默认没有的)
在httpd.conf中最后的位置添加
Include vhost-conf.d/*.conf
并在/etc/httpd/ 新建vhost-conf.d文件夹新建vhost-conf.conf文件
<VirtualHost *:443>
ServerName 域名名称
ServerAlias 域名名称
DocumentRoot /var/www/html/expert/public/
DirectoryIndex index.html index.php
</VirtualHost>
<Directory "/var/www/html/expert/public/">
Options FollowSymLinks
AllowOverride All
Order Deny,Allow
Allow from All
</Directory>
<VirtualHost *:80>
ServerName 域名名称
ServerAlias 域名名称
DocumentRoot /var/www/html/expert/public/
DirectoryIndex index.html index.php
</VirtualHost>
<Directory "/var/www/html/expert/public/">
Options FollowSymLinks
AllowOverride All
Order Deny,Allow
Allow from All
</Directory>
保存文件之后重启httpd即可
systemctl restart httpd
好了httpd的简单配置就完成了,可以搞起~~