Linux之Server环境配置
生活随笔
收集整理的這篇文章主要介紹了
Linux之Server环境配置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
第一部分:上傳代碼
使用ftp根工具進行上傳代碼
第二部分:路徑設置
在/etc/apache2/sites-available進行配置
?
大體設置
<VirtualHost *:80>ServerAdmin webmaster@localhostServerName public.localhost.itDocumentRoot /var/www/public/public# SetEnv APPLICATION_ENV "develop"<Directory /var/www/public/public>DirectoryIndex index.php index.htmlAllowOverride AllOrder allow,denyAllow from all# Require all granted</Directory>ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>?
設置完畢后:進行激活+重啟Apache
?
激活虛擬主機配置:sudo a2ensite
重啟Apache:sudo /etc/init.d/apache2 restart
第三部分:Win設置
在host設置,進行連接虛機IP與域名
?
#編程自學的域名 #127.0.0.1 localhost 127.0.0.1 local.html.com 127.0.0.1 local.css.com 127.0.0.1 local.js.com 127.0.0.1 local.bootstrap.com #127.0.0.1 local.wordpress.com 127.0.0.1 local.map.com 127.0.0.1 local.jquery.com 127.0.0.1 local.support.com 127.0.0.1 local.public.com 127.0.0.1 local.faq.com 127.0.0.1 local.pay.com 127.0.0.1 local.pay2.com 127.0.0.1 local.tp.com 127.0.0.1 local.admin.com 127.0.0.1 local.yii.com 127.0.0.1 local.ci.com 127.0.0.1 local.mi.com#系統Debian項目Sharengo的域名 192.168.216.130 public.localhost.it 192.168.216.130 admin.localhost.it 192.168.216.130 wordpress.localhost.it 192.168.216.130 support.linux.com?
vhost配置
?
#127.0.0.1 localhost #127.0.0.1 local.html.com #127.0.0.1 local.css.com #127.0.0.1 local.js.com #127.0.0.1 local.bootstrap.com #127.0.0.1 local.wordpress.com #127.0.0.1 local.map.com #127.0.0.1 local.jquery.com #127.0.0.1 local.support.com #127.0.0.1 local.public.com #127.0.0.1 local.faq.com#去wordpress文件夾 <VirtualHost *:80>ServerName local.wordpress.comDocumentRoot "D:\phpStudy\WWW\wordpress"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\wordpress">DirectoryIndex index.phpAllowOverride AllRequire all granted</Directory> </VirtualHost> #去測試頁面的 <VirtualHost *:80>ServerName local.test.comDocumentRoot "D:\phpStudy\WWW\test"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\test">DirectoryIndex index.phpAllowOverride AllRequire all granted</Directory> </VirtualHost> #去map頁面的 <VirtualHost *:80>ServerName local.map.comDocumentRoot "D:\phpStudy\WWW\map"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\map">DirectoryIndex index.php index.htmlAllowOverride AllRequire all granted</Directory> </VirtualHost> #去jquery頁面的 <VirtualHost *:80>ServerName local.jquery.comDocumentRoot "D:\phpStudy\WWW\jquery"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\jquery">#DirectoryIndex index.php index.htmlAllowOverride AllRequire all granted</Directory> </VirtualHost> #去support頁面的 <VirtualHost *:80>ServerName local.support.comDocumentRoot "D:\phpStudy\WWW\support"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\support">#DirectoryIndex index.php index.htmlAllowOverride AllRequire all granted</Directory> </VirtualHost> #去文件夾html <VirtualHost *:80>ServerName local.html.comDocumentRoot "D:\phpStudy\WWW\html"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\html">#DirectoryIndex index.htmlAllowOverride AllRequire all granted</Directory> </VirtualHost> #進入admin的 <VirtualHost *:80>ServerName local.admin.comDocumentRoot "D:\phpStudy\WWW\admin\public"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\admin\public">#DirectoryIndex index.phpAllowOverride AllRequire all granted</Directory> </VirtualHost> #進入public <VirtualHost *:80>ServerName local.public.comDocumentRoot "D:\phpStudy\WWW\public\public"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\public\public">#DirectoryIndex index.html index.phpAllowOverride AllRequire all granted</Directory> </VirtualHost> #進入問答項目的 <VirtualHost *:80>ServerName local.faq.comDocumentRoot "D:\phpStudy\WWW\faq"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\faq">#DirectoryIndex index.html index.phpAllowOverride AllRequire all granted</Directory> </VirtualHost> #進入pay的 <VirtualHost *:80>ServerName local.pay.comDocumentRoot "D:\phpStudy\WWW\pay"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\pay">#DirectoryIndex index.html index.phpAllowOverride AllRequire all granted</Directory> </VirtualHost> #進入pay2的 <VirtualHost *:80>ServerName local.pay2.comDocumentRoot "D:\phpStudy\WWW\pay2"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\pay2">#DirectoryIndex index.html index.phpAllowOverride AllRequire all granted</Directory> </VirtualHost> #進入tp的 <VirtualHost *:80>ServerName local.tp.comDocumentRoot "D:\phpStudy\WWW\tp"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\tp">#DirectoryIndex index.html index.php#是否允許外界進行訪問您的網站AllowOverride AllRequire all granted</Directory> </VirtualHost> #進入blogdemo2 <VirtualHost *:80>ServerName local.yii.comDocumentRoot "D:\phpStudy\WWW\blogdemo2"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\blogdemo2">DirectoryIndex index.html index.php#是否允許外界進行訪問您的網站AllowOverride AllRequire all granted</Directory> </VirtualHost> #進入ci <VirtualHost *:80>ServerName local.ci.comDocumentRoot "D:\phpStudy\WWW\ci"SetEnv APPLICATION_ENV "development"<Directory "D:\phpStudy\WWW\ci">DirectoryIndex index.html index.php#是否允許外界進行訪問您的網站AllowOverride AllRequire all granted</Directory> </VirtualHost>httpd.conf
DocumentRoot "D:\phpStudy\WWW" <Directory />Options +Indexes +FollowSymLinks +ExecCGIAllowOverride AllOrder allow,denyAllow from allRequire all granted </Directory>?
第四部分:訪問
?
總結
以上是生活随笔為你收集整理的Linux之Server环境配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 为何这支国产步枪现在却鲜为人知?
- 下一篇: 有哪些清洁厨房顽固油污的小技巧啊?