5

I want to install LAMP in Ubuntu. I have installed Apache. After the command sudo ufw allow in "Apache Full" it shows "unable to resolve host". How can I solve this?

  • see https://blog.netnerds.net/2016/04/active-directory-and-php-on-apache-on-bash-on-ubuntu-on-windows/ – Rinzwind Aug 06 '16 at 11:36

2 Answers2

7

To resolvethe host just add it to /etc/hosts, like at the example:

Resolve Host

For more details read this answer.


According to the @Rinzwind's comment, I think, port 80/443 must be opened in the Windows firewall. Here is a video instruction about it.


If you have a router and you want your web server to be accessible from outside, don’t forget to add some port forwarding. Something like that:

Port Forwarding


I will leave here and these few tips about UFW configuration on native Ubuntu:

To allow external access to Apache through UFW, you need to use:

sudo ufw allow http
sudo ufw allow https

To enable tcp protocol only use:

sudo ufw allow http/tcp
sudo ufw allow https/tcp

You can use and the port number directly:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

For some services (like "SSH" or "Webnin", which by default uses web interface at port 10000) you can add little security by using of limit rule instead of allow. This will limit the number of login attempts per certain time for these ports:

sudo ufw limit ssh/tcp
sudo ufw limit 10000/tcp

Just in case you can reload the "rules table":

sudo ufw reload
pa4080
  • 29,831
  • 1
    Sorry but he asked about bash in WINDOWS. How do you see this answering 1. that there is no GUI in windows (so you also need an X-server). and 2. that you need windows related software (like ktpass). – Rinzwind Aug 06 '16 at 11:35
2

Get updates

sudo apt-get update
sudo apt-get upgrade

Install LAMP

sudo apt-get install apache2 php5 libapache2-mod-php5 mariadb-server php5-mysql php5-cli php5-gd

Change port

if Windows is using 80 already

vim /etc/apache2/ports.conf

Change 80 to 8080

Start services

sudo service apache2 start
sudo service mysql start

Clean urls

sudo a2enmod rewrite
vim /etc/apache2/apache2.conf

Add:

AllowOverride All

Then:

sudo service apache2 restart

Create database

mysql -uroot -proot -e 'create database your-db-name;

Install Composer

Make it global

sudo mv composer.phar /usr/local/bin/composer
muru
  • 197,895
  • 55
  • 485
  • 740
sirkitree
  • 121