Modify Ubuntu13.04LAMP server port number

Source: Internet
Author: User
Because today I want to set the port number of an external web service of the Ubuntu13.04 server to 8000, I changed it myself, but it cannot be accessed, and the port is still 80. So I found a way to modify the port on the Internet. I have not modified a file yet. Let's talk about it here. For Ubuntu13.04, You need to modify it. First, you must note that you need to modify the port in two places, not the WAMP in Windows. They are sudovi/etc

Because I want to set the port number of an external web service of an Ubuntu 13.04 server to 8000, I changed it myself, but it cannot be accessed, and the port is still 80. So I found a way to modify the port on the Internet. I have not modified a file yet. Let's talk about it here.

For Ubuntu 13.04, You need to modify it.

First, you must note that you need to modify the port in two places, not the WAMP in Windows.

They are sudo vi/etc/apache2/sites-available/000-default.conf (a configuration file is created by a virtual host by default on the Ubuntu server) and/etc/apache2/ports. conf.

This is my installation path, which is not difficult to find.

You just need to change the port number 80 to your favorite.

For example, the default file contains the following (there is only one 80)

Run the following command on the terminal:

Sudo vi/etc/apache2/sites-available/000-default.conf
(Press enter and enter the root password)


ServerAdmin webmaster @ localhost

DocumentRoot/var/www

Changed:


ServerAdmin webmaster @ localhost

DocumentRoot/var/www

Press ESC and enter wq (and press enter to save)

In the ports. conf file (in the original article, there are two 80, and Ubuntu 13.04 has only one)

Run the following command on the terminal:
Sudo vi/etc/apache2/ports. conf
(Press enter and enter the root password)

Listen 80

Changed:

Listen 8080.

Press ESC and enter wq (and press enter to save)

Restart apache after both files are changed.

Sudo/etc/init. d/apache2 restart
Try it in the browser !!

Recommended reading:

Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04Http://www.linuxidc.com/Linux/2013-06/86250.htm

Compile and install LAMP (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm in CentOS 5.9

Source code construction of Web Server Architecture in RedHat 5.4 LAMP environment and application PHPWind http://www.linuxidc.com/Linux/2012-10/72484p2.htm

LAMP source environment to build WEB Server Linux + Apache + MySQL + PHP http://www.linuxidc.com/Linux/2013-05/84882.htm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

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.