假设CentOS6.8, LAMP
lamp 的全称是linux + apache + mysql +php
lnmp 的全称是linux + nginx + mysql + php (国外喜欢简称为LEMP,搜英文资料需要搜LEMP)
Nginx 性能稳定、功能丰富、运维简单、处理静态文件速度快且消耗系统资源极少。
Apache 是 LAMP 架构最核心的 Web Server,开源、稳定、模块丰富是 Apache 的优势
静态的多用lnmp还是不错的
动态内容多的话,lamp还是最稳定的
首先去添加二级域名解析,然后编辑服务器文件:
1./etc/httpd/conf/ 在httpd.conf文件最后添加
RewriteEngine onRewriteMap lowercase int:tolower
RewriteMap vhost txt:/etc/httpd/vhost.map
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$
RewriteCond ${vhost:%1} ^(/.*)$
RewriteRule ^/(.*)$ %1/$1
二级1.******.cn /var/www/html/二级1
二级2.******.cn /var/www/html/二级2
修改文件夹权限
[root@localhost ~]# chmod 777 /home/user 注:仅把/home/user目录的权限设置为rwxrwxrwx[root@localhost ~]# chmod -R 777 /home/user 注:表示将整个/home/user目录与其中的文件和子目录的权限都设置为rwxrwxrwx