apache的Alias配置

來源:互聯網
上載者:User

在 apache中配置Alias,如下格式

 

<VirtualHost *:80><br /> ServerAdmin webmaster@localhost<br /> DocumentRoot /var/www<br /> <Directory /><br /> Options FollowSymLinks<br /> AllowOverride None<br /> </Directory><br /> <Directory /var/www/><br /> Options Indexes FollowSymLinks MultiViews<br /> AllowOverride None<br /> Order allow,deny<br /> allow from all<br /> </Directory><br /> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/<br /> <Directory "/usr/lib/cgi-bin"><br /> AllowOverride None<br /> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch<br /> Order allow,deny<br /> Allow from all<br /> </Directory><br /> ErrorLog ${APACHE_LOG_DIR}/error.log<br /> # Possible values include: debug, info, notice, warn, error, crit,<br /> # alert, emerg.<br /> LogLevel warn<br /> CustomLog ${APACHE_LOG_DIR}/access.log combined<br /> Alias /doc/ "/usr/share/doc/"<br /> <Directory "/usr/share/doc/"><br /> Options Indexes MultiViews FollowSymLinks<br /> AllowOverride None<br /> Order deny,allow<br /> Deny from all<br /> Allow from 127.0.0.0/255.0.0.0 ::1/128<br /> </Directory><br /> Alias /pics "/exports/flv12"<br /> <Directory "/exports/flv12"><br /> Options Indexes<br /> AllowOverride AuthConfig FileInfo<br /> Order allow,deny<br /> Allow from all<br /> </Directory><br /> Alias /videos "/exports/flv14"<br /> <Directory "/exports/flv14"><br /> Options Indexes<br /> AllowOverride AuthConfig FileInfo<br /> Order allow,deny<br /> Allow from all<br /> </Directory><br /></VirtualHost> 

 

注意,要將httpd.conf的

User和Group設定為有許可權訪問Alias指向目錄。否則訪問會出現403 forbidden

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.