Operations and problems of apache2 in ubuntu11.10

Source: Internet
Author: User

This is a tough issue. I want to record it to vent my anger:
 
1. Restart apache:
 
1
Sudo/etc/init. d/apache2 restart
 
 
2. [warn] NameVirtualHost *: 80 has no VirtualHosts will appear after the apache Virtual Host
 
Solution: comment out the NameVirtualHost *: 80 line in httpd. conf.
 
Cause: the syntax of NameVirtualHost is incorrect. If the same host supports multiple virtual hosts, you only need to name NameVirtualHost once. If NameVirtualHost *: 80 is added to each virtual host configuration file, this warning is reported.
 
Originally in/etc/apache2/ports. *: The VirtualHost of 80 is defined in conf. the conf file is redefined, so it is wrong. just comment out httpd. in conf, The NameVirtualHost *: 80 is OK;
 
 
 
3. Enable Apache rewrite extension on the ubuntu Server:
 
Step 2: Open the terminal and enable the extension:
 
1
Sudo a2enmod rewrite
Or:
 
1
Sudo ln-s/etc/apache2/mod-cuailable/rewrite. load/etc/apache2/mod-enabled/rewrite. load
Step 2: Modify something
1
Sudo vim/etc/apache2/sites-enabled/000-default
Modify All AllowOverride None to AllowOverride All.
Note: 000-default is actually a link of sites-available/default, and AllowOverride None is ignored completely. in the htaccess file, the rewrite rule does not take effect. In addition, note that the permission of your program file cannot be disabled. Therefore, you must modify the 000-default file after enabling the extension.
 
Then restart the apache service;
 
1
Sudo/etc/init. d/apache2 restart
Other references:
 
The rewrite module of apache2 in Ubuntu is not loaded by default.
 
Run this command: a2enmod rewrite to enable the rewrite module.
 
Or:
 
Sudo ln-s/etc/apache2/mod-available/rewrite. load/etc/apache2/mod-enabled/rewrite. load
 
Apaceh2 has a set of a2enmod and a2dismod commands for enabling and disabling Apache modules. A2enmod is used to enable a specified module in Apache. In fact, it creates a symbolic link for the module file in the/etc/apache2/mod-enabled directory. In contrast, a2dismo disables a specified module by deleting the symbolic link. Of course, no error is reported if you enable an enabled module or disable a disabled module.
 
It is worth noting that:
 
/Etc/apache2/mod-available: Put the module files available for apache
 
/Etc/apache2/mod-enabled: Link to the module File enabled by apache
 
Check the/etc/apache2/mod-enabled directory. A rewrite. load link is added.
 
 
 
The author is really a tragic and Happy Man

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.