Install Apache on Ubuntu

Source: Internet
Author: User
Ubuntu provides us with the suapt-getinstall command, through which you can easily install some software, which is placed on the servers in various places of Ubuntu, if the software you want to install is common, you can download it. sudoapt-getinstallapache2 configuration site directory, In Ubuntu under the apache directory storage method and Window has a lot of difference, its configuration file is stored in

Ubuntu provides us with the su apt-get install command, through which you can easily install some software, which is placed on the servers in various places of Ubuntu, if the software you want to install is common, you can download it.

Sudo apt-get install apache2

Configure the website directory. The apache directory under Ubuntu is stored in a very different way than the Window directory. Its configuration file is stored in the etc/apache2/folder, the previous configuration files are divided

Etc/apache2/conf. d/charset
This is the website encoding configuration, the content inside is very little, open to see it will know, I here will be the last line of # AddDefaultCharset UTF-8 in front of # Remove, use UTF-8 encoding, of course you can also change the UTF-8 into another code.
Etc/apache2/sites-available/default
This is the website directory configuration. If you want to change the website directory, modify this. The default website directory is/var/www (the owner is root, so it is inconvenient to modify it)
Like a LINUX source, you must have certain permissions to modify the above configuration file. You can do this:
1: su enter root Password 2: gedit etc/apache2/conf. d/charset
Or you can directly obtain the temporary permission.
1: sudo gedit etc/apache2/conf. d/charset

Restart apache,
Sudo service apache2 restart
Yes.
Sudo/etc/init. d/apache2 restart

BTW: init. d below is the startup registration of system service programs (such as xinet, samba, vsftp, xserver, apche, mysql) for each init. files in the x Directory indicate whether or not services are running at the running level. The files are usually scripts used to start and end services, you can use any editor to view the specific content.

By the way, mysql is enabled in the same way as apche:
Sudo/etc/init. d/mysql start
I do not know when I have successfully installed mysql. Because my/etc/nit. d/directory contains the mysal file, I enter mysql on the terminal and prompt
ERROR 1044 (42000): Access denied for user ''@ 'localhost' to database 'H'
I think it is also caused by permission issues.
Mysql -- user = root-p
Right, then you can run the MySql command on the final disconnection, for example

Mysql> show databases;

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.