Hi all,
I am new member in this community.I am a software developer in java/j2ee platform. Recently i have develop a web site in jsp. I use Tomact 4.1,Mysql data base . Now its working fine inside my LAN .Every one can access with my IP address in my LAN. Now i have a static IP and i want to host it so that everyone can access this portal .So pls tell me the procedure that how can i host it using that static IP. what should i install in that machine and how can i set a virtual name for my portal...

Thanks in advance

Dani AI

Generated

Below is a concise, practical checklist that builds on ’s question and the replies from and . It focuses on the concrete steps you can apply on the machine that will serve your site, plus a few safety and maintenance notes.

Start the server correctly: run the JVM and servlet container under a dedicated, non-root account and install them as a service so they restart on boot. Example systemd unit (adjust paths/JAVA_HOME to your environment):

[Unit]
Description=Tomcat
After=network.target

[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=JAVA_HOME=/usr/lib/jvm/java-11-openjdk
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target

Application and DB best practices: deploy your app as a WAR, give the app its own DB user with only the needed privileges, and keep the DB bound to localhost so it is not directly exposed. Example SQL for a limited user:

CREATE USER 'appuser'@'localhost' IDENTIFIED BY 'strongPass';
GRANT SELECT, INSERT, UPDATE, DELETE ON mydb.* TO 'appuser'@'localhost';
FLUSH PRIVILEGES;

Front-end proxy, virtual name and TLS: put a light reverse proxy (nginx or Apache) in front to handle the public name, TLS termination and static files. Sample nginx server block:

server {
    listen 80;
    server_name example.com www.example.com;
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Operational checklist: restrict services with the host firewall, lock down admin/manager apps, automate nightly DB dumps and rotate logs, enable automatic certificate renewal if using Let’s Encrypt, and add simple intrusion detection (fail2ban). Test from an external network and monitor availability. If uptime, bandwidth, or ISP policy are concerns, consider a VPS or managed host instead of a home connection.

Recommended Answers

All 3 Replies

you don't need anything you don't have on your LAN connection, but you may need to open some ports on your firewall (especially the port on which Tomcat is serving content over http, usually port 8080 with Tomcat though using port 80 is nicer as it's the standard for http).

Domain names you'll need to buy, there are many companies selling them over the net for not a lot of money per year.
Make sure your ISP allows you to do this though, some (many?) will kick you off the network if you host a server over your home connection.
Others will allow it if you upgrade to a corporate account.
Some also sell (or help you to buy) domain names and hosting services.

Hi all,
I am new member in this community.I am a software developer in java/j2ee platform. Recently i have develop a web site in jsp. I use Tomact 4.1,Mysql data base . Now its working fine inside my LAN .Every one can access with my IP address in my LAN. Now i have a static IP and i want to host it so that everyone can access this portal .So pls tell me the procedure that how can i host it using that static IP. what should i install in that machine and how can i set a virtual name for my portal...

Thanks in advance

from what i learnt of what ypu have posted is that you have hosted your website on the local lan.could you please give me step by step procedure to host a website on a LAN.

don't hijack other peoples' threads, it's extremely rude.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.