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.04
Compile and install LAMP in CentOS 5.9 (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12)
Source code for Web server architecture in RedHat 5.4 build the LAMP environment and application PHPWind
Build a WEB Server Linux + Apache + MySQL + PHP in the LAMP source code Environment