laravel 筆記 虛擬網站設定
laravel 的虛擬網站設定 因為使用者看到的 laravel 網頁,實體位置是在 newedApp/public 裏,所以用 apache 預設的 userdir 設定恐怕是得繞些路,而且因為有機會瀏覽核心的文件,在安全上疑慮可能多一些,所以這次要針對這個部份加以設定,把使用者直接導到 newedApp/public 目錄。 以下範例,以 abc 的 app 專案為例,依樣畫狐狸就可以連到 app 的網站: 將設定存到 /etc/apache2/sites-availabe/abc.conf > sudo a2ensite abc.conf ,/etc/apache2/sites-enabled 下就會多一個連結 > sudo service apache2 restart /etc/apache2/sites-availabe/abc.conf: <virtualhost> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "/home/abc/public_html/app/public" ServerName abc.local ServerAlias www.abc.local ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <directory "/home/ricky/public_html/emsl/public"> Options Indexes MultiViews FollowSymLinks AllowOverride All Require all granted </directory> </vir...