การเปลี่ยนแปลง web folder จาก /var/www เป็นที่อื่น ของ UBUNTU

สำหรับผมเคยใช้ Fedoracore มาจะคุ้นเคยกับที่เก็บ ข้อมูลของ webpage /var/www/html
แต่พอมาใช้ UBUNTU ตำแหน่งที่เก็บ จะมีแค่ /var/www เท่านั้น ดังนั้น
หากต้องการทำให้เป็นแบบเดียวกับ ของ Fedoracore ก็สามารถทำได้ดังนี้ครับ
ไปที่ 
cd /etc/apache2/sites-available
หรือ 
nanao  /etc/apache2/sites-available/default
ก็จะปรากฏ รายละเอียดดังนี้
NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost

DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # Uncomment this directive is you want to see apache2's
                # default start page (in /apache2-default) when you go to /
                #RedirectMatch ^/$ /apache2-default/
        #add these 3
        AddHandler mod_python .py
        PythonHandler mod_python.publisher
        PythonDebug On
        #/add these 3
        </Directory>
.
..........
เราก็แก้ไขให้เป็นดังนี้
NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost

DocumentRoot /var/www/html
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # Uncomment this directive is you want to see apache2's
                # default start page (in /apache2-default) when you go to /
                #RedirectMatch ^/$ /apache2-default/
        #add these 3
        AddHandler mod_python .py
        PythonHandler mod_python.publisher
        PythonDebug On
        #/add these 3
        </Directory>
 
จากนั้น ก็สร้าง directory ใหม่ด้วย
mkdir -p /var/www/html
แล้วก็สั่งให้ restart apache ใหม่
/etc/init.d/apache2 restart
เท่านี้ก็เรียบร้อยครับ ทดลองดูแล้วกันนะครับ
เครดิต  :  http://mrkohkoh.exteen.com/

1 comment to การเปลี่ยนแปลง web folder จาก /var/www เป็นที่อื่น ของ UBUNTU

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>