linode
add a new linode
sudo apt-get update // apt-get install 前 update
sudo apt-get install apache2
綁定域名
1 vim /ect/apache2/apache.conf
添加行:
<Directory /srv/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
(注:缺這一步,瀏覽器訪問報錯:
Forbidden
You don't have permission to access / on this server.
)2
cd /srv
mkdir www
cd www
mkdir exaple.com
cd exaple.com
mkdir public.html
mkdir logs
vim index.html
3 cd /etc/apache2/sites-avaible
vim example.com.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName example.org
ServerAlias www.example.org
DocumentRoot /srv/www/example.org/public_html/
ErrorLog /srv/www/example.org/logs/error.log
CustomLog /srv/www/example.org/logs/access.log combined
</VirtualHost>
4
sudo /etc/init.d/apache2 restart
再用瀏覽器訪問 example.org 就可以看到頁面。