Skip to main content

INSTALLING WEB SERVERS ON UBUNTU® | LINUX SERIES


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 servers
for 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 the
programming 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 AllowOverride 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 +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ 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.gz
tar -xvzf wildfly-10.0.0.Final.tar.gz
mv wildfly-10.0.0.Final wildfly
chmod -R 755 wildfly
cd 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 a
new user.

INSTALLING AND CONFIGURING NGINX ON UBUNTU ®


NGINX is a web server used for hosting PHP web applications just like Apache that we
installed 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 to
get updates of the current packages.

sudo apt-get update
sudo apt-get install nginx

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

Peace Out.
@suhaibbinyounis

Comments

Popular posts from this blog

Make money with Quora Partner Program | Explained

Earning money ain't it...
I know we all have some time wondered if it is possible to earn money online and believe me there are many ways to do that and it is all amazing.
In this post I will specifically talk about Quora Partner Program, QPP.

Quora came out with this amazing program that allows anyone in world to make a living out of writing. But speaking the truth it is not that much. It quite a hard work and less pay job.
Bascially, all you do is ask questions and then these questions will receive Ad impressions for which you get paid.

But here is the deal, you can monetize a question only for 1 year only. After that Quora owns the question.


So, how do you get started?

As of now there is no direct way of joining the QPP. The only way for you to join is if you receive a email from Quora itself which is quite random and obviously how active you are on quora will play a part.


So, how much can i earn?
Well, there is no limit on how much you can earn. Generally the money is way too low but t…

RESOLVING NETWORK ISSUES ON LINUX | LINUX SERIES

Dealing with networking issues can be a very challenging task. A packet sent from a client to a server (or vice versa) might be dropped in various locations and for various reasons. Some of the most common cases are -
1. A firewall that is blocking the packet. It can be a firewall on the server side, on the client side or any firewall along the way between the server and the client. The blocking may be based on an ip (source and/or destination), ports (in case of tcp/udp) or any other layer 3,4 criteria.

2. Lack of layer 2 connectivity.

3. Routing configurations that are not set properly.

Fortunately, Linux command line tools supply significant information that might help us narrow down the problem. From my experience those are my top 8 tools that will help you overcome networking issues.
 ping
This is the most fundamental command when troubleshooting a networking issue. The ping command will test the network connectivity between your host and the server. This is definitely the first comman…

Magic SysRq key | Linux Rescue | Frozen Linux | LINUX SERIES

The magic SysRq key is a key combination which allows the user to perform various low-level commands regardless of the system's state. If your Linux machine freezes or you want to reboot your Linux machine without corrupting the filesystem you can use this magic SysRq key combination. This key combination provides access to powerful features and thus needs some knowledge to use it. Please do not proceed without knowing about these combinations as you may put your system in a critical state. Please note that this magic SysRq key cannot work under certain conditions, such as a kernel panic or a hardware failure preventing the kernel from running properly.
Commads:The key combination consists of Alt+SysRq and another key, which controls the command issued. SysRq may be released before pressing the command key, as long as Alt remains held down.
These combinations always assume the QWERTY keyboard layout.
1. Immediately reboot the system, without unmounting or syncing filesystems - b 2. Perfor…