C
C
Chvalov2014-08-21 17:49:56
linux
Chvalov, 2014-08-21 17:49:56

How to open website access from outside on ubuntu server 14.04 with apache 2?

Hello, raised a web server on ubuntu-server 14.04.1 installed

sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql imagemagick
sudo apt-get install mysql-server
sudo apt-get install phpmyadmin
Then I rebooted and configured pppoe with a static ip address.
By local ip, the site opens, the one in /var/www/htmlI created a folder with my site /var/www/mysite.loc/public_html/, filled in the site, created the necessary config in/etc/apache2/sites-available/mysite.loc.conf
<VirtualHost *:80>
 ServerName myovis.loc
 ServerAdmin [email protected]

 Alias /myovis /var/www/myovis.loc/public_html

 DocumentRoot /var/www/myovis.loc/public_html
 <Directory />
  Options FollowSymLinks
  AllowOverride None
 </Directory>
 <Directory /var/www/myovis.loc/public_html>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  allow from all
 </Directory>

 ErrorLog /var/log/apache2/error.log

 LogLevel debug

 CustomLog /var/log/apache2/access.log combined
</VirtualHost>
I picked up the database, turned it on sudo a2ensite mysite.locand now I can access the site only if in Windows I register the host and domain in /windows/system32/drivers/etc/ hosts
How can I make mysite.loc be accessed via an external static ip ?
Even if the external ip does not open a site that goes to apache by default?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Igor, 2014-08-21
@Chvalov

Show the output of the commands:

ip a
netstat -ntpua | grep apache
iptables-save

F
formsspring, 2014-08-23
@formspring

/etc/apache2/sites-available/mysite.loc.conf does
sites-enable have the same config?

O
Optimus159, 2015-01-21
@Optimus159

In order to have access to the site only by static ip ( http://192.168.0.1), you need to create a virtual host with the name 192.168.0.1.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question