วันอังคารที่ 21 ตุลาคม พ.ศ. 2551

apache set DNS

1. จับตาดู web05 ให้ดีนะเธอว์

/etc/apache2/apache2.conf
ServerRoot "/etc/apache2"
ServerName web05:80   # or localhost:80
ServerName web1:80
ServerName web07:80
2.
$ cd /etc/apache2/sites-available
$ sudo cp default web05
$ sudo vim web05  # or localhost 


NameVirtualHost web05:80    # or localhost:80
NameVIrtualHost web05:443
<VirtualHost web05:80>      # or localhost:80
     ServerAdmin webmaster@localhost

     DocumentRoot /var/www/web05
     RailsBaseURI /ror
     # RailsBaseURI /mybasics
     <directory>
             Options FollowSymLinks
             AllowOverride None
     </directory>
     <Directory /var/www/web05>
             Options Indexes FollowSymLinks MultiViews
             AllowOverride None
             Order allow,deny
             allow from all
   

     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
     <directory>
             AllowOverride None
             Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
             Allow from all
     </directory>

     ErrorLog /var/log/apache2/error.log

     # Possible values include: debug, info, notice, warn, error, crit,
     # alert, emerg.
     LogLevel warn

     CustomLog /var/log/apache2/access.log combined
     ServerSignature On

 Alias /doc/ "/usr/share/doc/"
 <directory>
     Options Indexes MultiViews FollowSymLinks
     AllowOverride None
     Order deny,allow
     Deny from all
     Allow from 127.0.0.0/255.0.0.0 ::1/128
 </directory>


<VirtualHost web05:443>
.
.
.



3.
/etc/hosts
192.41.170.105 web05  # หรือ 127.0.0.1 localhost หรือ 127.0.2.1 web05


5.
$ sudo a2ensite localhost


6.
$ cd /var/www
$ sudo mkdir web05  # or localhost
$ sudo chown -R yourusername.www-data web05/  # or localhost
$ cd web05 # or localhost
$ vim index.php

1)
Possible error : Forbidden You don't have permission to access / on this server
Solution : http://stackoverflow.com/questions/21551840/forbidden-you-dont-have-permission-to-access-on-this-server
2)
Need put ServerName
3)
rename the file with .conf if not we will end the error when a2ensite

ไม่มีความคิดเห็น:

LinkWithin

Related Posts Plugin for WordPress, Blogger...