Monday, December 24, 2012

Configure JAVA Servlet or JSP webserver in linux (Fedora), which can be accessed over Internet

This blog is for those who want to test or release a private java webserver (weblogic, websphere, Glass-fish, Tomcat...) over internet.

*if you have already used any linux distribution, it will easy to configure otherwise you have to learn some basics of Linux (file-system, terminal/console, root account, console editors 'vi')



Follow these easy steps:-

1). Download Fedora iso file from get.fedoraproject.org/ 

2). Install fedora as any other linux(make user account and password)

4). Create root account 'How to make root account in linux'

5). Disable SELinux:-
            a). open terminal and switch user to root account   
                 $su
            b). edit /etc/selinux/config file via 'vi' editor
                  $vi /etc/selinux/config
            c). disable SELinux
                 SELINUX=disabled

           file /etc/selinux/config:          


6). Now OS is able to make server over internet
      if you want to run webservers like websphere or weblogic, you have to download and install linux compatible installation file, then configure and run from root account. It will bit complex for beginners.

      But beginners can try an easy and effective way- Install NETBEANS of J2EE version.

steps-
a). download and install jdk for linux from oracle website or Install jdk from software center of fedora

b). Download NETBEANS-J2EE version 
     click here to download

c). Install NETBEANS with Glass-fish or Tomcat web-servers
     $sudo '/path of netbeans-7.2.1-ml-javaee-linux.sh'
   (*Installation may require JVM path in terminal) 

d). Connect your PC to Internet and note down IP of PC(to get IP, use 'ipconfig' command in terminal)

e). Now open NETBEANS via root account
     (open terminal > $sudo '/path of netbeans .sh file')

f ).  you can import and run your complete project in NETBEANS
      Browser address will seem as- http://localhost:80/project_name/index.html

      replace localhost:80 to xxx.xxx.xxx.xxx your PC IP
      
Now you can access your website though http://xxx.xxx.xxx.xxx/project_name/index.html from internet connected computer or mobile.
This time your computer is working as webserver-host.

*Remember if you are using college or organization internet which has some Intranet architecture, your server will not work over internet. It will work only in Intranet(only in organization) because for hosting a webserver, host IP should be unique in internet but organization distributes only Intranet IP(Standard IP over Internet remain same for all computers in the organization). So if you want to test it over internet, you have to use dongle or broadband connection.

  Please write if have any problem or question in any step
 and if it is helpful and working.. please like/+1 the post.

Thank you ...

No comments:

Post a Comment

How to setup a Solr Search Engine, run indexing and writing queries

Content will be added