Install Apache2.0 and other related systems in Ubuntu

Source: Internet
Author: User
Here we will introduce in detail the application of various systems in Ubuntu, and hope it will be useful to you. Ubuntu Declaration: software should be provided free of charge, software tools should be available in the form of local languages without sacrificing any functionality, and people should have the freedom to customize and change their software, this includes any method that they consider appropriate. 1. Install apache(1)source code installation 1.go to the official website to download apache2.0 decompressed httpd-2.0.63.tar.gz (for example, you can also update the version) to the temporary directory

Here we will introduce in detail the application of various systems in Ubuntu, and hope it will be useful to you.

Ubuntu Declaration: software should be provided free of charge, software tools should be available in the form of local languages without sacrificing any functionality, and people should have the freedom to customize and change their software, this includes any method that they consider appropriate.

1. install Apache

(1) Source Code Installation

1. Go to the official website to download apache2.0 and decompress httpd-2.0.63.tar.gz (for example, you can also update the version) to the temporary directory, as shown in ~ Httpd-2.0.63
2. Go ~ /Httpd-2.0.63 directory, execute
#./Configure -- prefix =/usr/local/apache2 -- enable-module = so
# Make
# Make install
In actual execution, you may be required to have the root permission, so you must use sudo.
If the mod_rewrite module is required, the parameter -- enable-rewrite must be added.
3. Start and Stop apache
Start: sudo/usr/local/apache2/bin/httpd-k start
Prompt at startup:
Httpd: cocould not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName.
The solution is to add a line in http. conf:
ServerName 127.0.0.1: 80
Stop: sudo/usr/local/apache2/bin/httpd-k stop
4. Enable Ubuntu to automatically start apache.
1). Copy/usr/local/apache2/bin/apachectl to/etc/init. d.
2) load as a service
Sudo update-rc.d apachectl defaults
Access http: // localhost/When the apache webpage is displayed, www.linuxidc.com indicates that the automatic startup is successful.

(2) Direct Installation

Sudo apt-get install apache2

Ii. install various systems

1. First Install SSH
Sudo apt-get install ssh
2. Install MySQL
Sudo apt-get install mysql-server-5.1
3. install PHP
Sudo apt-get install php5 libapache2-mod-php5
4. Restart Apache
Sudo/etc/init. d/apache2 restart
5. Install phpMyAdmin
Sudo apt-get install phpmyadmin

Another method: Install LAMP and select edit in the new software package manager -- use the task group to mark the software package in the open window, select lamp server and click the red/palladium check box in the main window. The next step is to automatically download and install the new SDK. You will be prompted to enter the mysql root User Password.

Iii. Test

1. Test Ubuntu Apache
Enter http: // localhost/to check whether the words It works appear.
2. Test MySQL input:
Sudo netstat-tap | grep mysql can see rows similar to the following: tcp 0 0 localhost. localdomain: mysql *: * LISTEN-if the server cannot run normally, you can run the following command to start it: sudo/etc/init. d/mysql restart
3. Test PHP
The root directory of Ubuntu Apache is located in/var/www and a test file is added to it. PHP file, content browser re-enter http: // localhost/test. php. If you see the php information page, the PHP installation is successful.

4. Configure various systems

1> apache configuration file path/etc/apache2/apache2.conf
2> php. ini path/etc/php5/apache2/php5.ini
3> mysql configuration file path/etc/mysql/my. cnf
4> phpmyadmin configuration file path/etc/phpmyadmin/apache. conf
5> website root directory/var/www

1. Configure PHP5
There is nothing to say about this. The default time zone is shown below as needed; default. timezone = PRC (remove the semicolon above to represent China)

2. Configure mysql
Sudo gedit/etc/mysql/my. cnf has a major note here, because it only allows local access to the database by default. If necessary, you can enable bind-address 127.0.0.1 to restrict local access only, if you need access from other machines, comment out this sentence #.

3. Configure phpmyadmin
Phpmyadmin is not installed under/var/www by default, but under/usr/share/phpmyadmin. You can copy phpmyadmin or create a link on the Internet, then copy the Link (not tried ). I personally think it is not necessary to copy it. If you do not copy the file, you do not need to change the configuration and run sudo gedit/etc/phpmyadmin/apache on the terminal. conf: change the path of the following two names to/var/www/phpmyadmin Alias/phpmyadmin/usr/share/phpmyadmin.

4. in ubuntu, modify the Ubuntu Apache website root directory DocumentRoot. In the/etc/apache2/sites-enabled/directory, you can see a 000-default file. In this case, DocumentRoot/var/www changes the path. restart the Apache2 service.

Operator: Common commands
1. restart apahce sudo/etc/init. d/apache2 restart.
2. restart mysql sudo/etc/init. d/mysql restart.
Now, the LAMP environment is configured successfully.

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.