S
S
sitev_ru2015-06-23 11:51:36
Apache HTTP Server
sitev_ru, 2015-06-23 11:51:36

How to change apache port?

I have apache on port 80. I want to change it, for example, to 8080...
Changing /etc/apache2/ports.conf here does not help. After restarting apache, the port is restored to 80. I changed it in other places - the same thing ...
Tell me the right option?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Heizenberg, 2015-06-23
@Heizenberg

here /etc/apache2/ports.conf

NameVirtualHost *:8080
Listen 8080

and here /etc/apache2/sites-available/default
sudo service apache2 restart

S
ShamblerR, 2015-06-24
@ShamblerR

sed -i 's/:80>/:8080>/g' /etc/apache2/sites-available/*.vhost
sed -i 's/80/8080/g' /etc/apache2/ports.conf
sed -i 's/:80/:8080/g' /etc/apache2/sites-available/default

/etc/init.d/apache2 restart

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question