INSTALLING WEB SERVERS ON UBUNTU®






Web server is a kind of a container that contains a web application programmed by software
and web application programmer and the web application performs all of its functionality
using the web server.





INSTALLING GLASSFISH SERVER ON UBUNTU ®










First, let us get to install glassfish server as one of the most popular web application serversfor java programming language as follows:





sudo apt-get update
sudo apt-get install default-jdk
wget http://download.java.net/glassfish/4.1.1/release/glassfish-4.1.1.zip
unzip glassfish-4.1.1.zip
glassfish4/bin/asadmin start-domain

Configuring Glassfish Server:





1. Open the URL http://localhost:4848





2. Then browse to the left side panel and select server-config





3. After that, go to Network Listeners, then





4. Set http-listener-1 to port 80 for default http listening
After that, we will move on to the next installation which is:





INSTALLING AND CONFIGURING APACHE WEB SERVER ®










Apache web server is used as a stack bundled with PHP, and MySQL and PHP is theprogramming language and MySQL is the database engine.
Apache web server installation is as follows:





sudo apt-get update
sudo apt-get install tasksel
sudo tasksel install lamp-server





The configuration of apache on ubuntu using the following command:






sudo nano /etc/apache2/sites-available/000-default.conf






Then, we will go to the section Allow Override and set it to all as follows:






AllowOverride all





OR





AllowOverride All






This option will allow override if your application in PHP requires MVC pattern. Then we will create a file called .htaccess where index.php is located of the application that you will deploy into your application server as follows:






sudo nano /var/www/html/.htaccess






Then we will put the contents if the application only redirects all routes to the index.php file as follows:






Options +FollowSymLinksRewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^ index.php [L]





Now, we will work with our next installation which will be:





INSTALLING JBOSS APPLICATION SERVER










JBoss Application Server is another application server for hosting Java web applications.Installing JBoss requires the following commands:





wget http://download.jboss.org/wildfly/10.0.0.Final/wildfly-10.0.0.Final.tar.gztar -xvzf wildfly-10.0.0.Final.tar.gzmv wildfly-10.0.0.Final wildflychmod -R 755 wildflycd bin/./add-user.sh#this will add a user./standalone.sh#this will run the server





Now, let us go ahead and open the following URL:http://127.0.0.1:9990
This way, we have finished installing our glassfish server and configured it by adding anew user.





INSTALLING AND CONFIGURING NGINX ON UBUNTU ®










NGINX is a web server used for hosting PHP web applications just like Apache that weinstalled before.Now, we will perform the command:






sudo sh -c "echo 'deb http://nginx.org/packages/mainline/ubuntu/'$(lsb_release -cs)' nginx' > /etc/apt/sources.list.d/Nginx.list"






This command added a list into our sources.list.d into our UBUNTU ® lists that it uses toget updates of the current packages.






sudo apt-get updatesudo apt-get install nginx






This way, we have installed NGINX as our web application server and please do not makean interfer on your machine by installing more than 1 web server per OS installation becausemost of the web servers use the same protocols and only one protocol can save one serverat a time or you will need to re-configure each web server to use different protocol.






Peace out
@suhaibbinyounis


Post a Comment

Post a Comment (0)

Previous Post Next Post