LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-22-2006, 07:34 PM   #1
LowKey
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Rep: Reputation: 0
Newbie trying to set up a Web Server


Hi there,

First of all, thanks to all who contribute to helping me. It is really appreciated.

My main computer is a Windows PC, but I recently revived a old PC AMD Athlon 1.3Ghz and it was just sitting around so I decided that instead of using my current system to do PHP and web stuff I could make a web server on the other machine and have it host it. I dont plan on hosting large sites just mainly my personal site and test apps.

So I installed Suse Linux following guides, and then proceeded to start a LAMP. My main goal is to have this Linux server sit here so I can SSH into it from my Windows machine when I want to upload work to test.

So main objectives:
  • Linux Installed
  • Apache Installed
  • MySQL installed
  • PHP Installed
  • PHPMyAdmin installed
  • Some form of SSH
  • server accessible from the web

I have linux installed, and followed the following guide to do the rest: wwwDOTnovell.com/coolsolutions/feature/595.html

It was fairly helpful as I have Apache MySQL, PhpMyAdmin and MySQL installed and working. Well that is for MySQL.

So I installed it via the RPM and I can log on to it using PHPMyAdmin as root no password but the guide says to type mysql -u root mysql, but when I do this logged on as root I get an error "Acess denied for user 'root'@'localhost', ive spent hours looking for a solution for this, im to the point where im severly frustereated. So if anyone knows of a guide to uninstall MySQL and install it properly step by step in 'idiot' fashion then Id be thankful. I guess there is stuff to do with groups and permissions w/e I thought I followed the above guide well enough, I guess not.


So second problem is, thay machine is on my local LAN, if I type in the network address which is 192.168.100.110 for example then I get nothing. I even try just using its IP address and still cant load the home page from other machines. Am I misisng a setting or is this purely a networking issue?

Thanks!
 
Old 06-22-2006, 07:46 PM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Quote:
So I installed it via the RPM and I can log on to it using PHPMyAdmin as root no password but the guide says to type mysql -u root mysql, but when I do this logged on as root I get an error "Acess denied for user 'root'@'localhost', ive spent hours looking for a solution for this, im to the point where im severly frustereated. So if anyone knows of a guide to uninstall MySQL and install it properly step by step in 'idiot' fashion then Id be thankful. I guess there is stuff to do with groups and permissions w/e I thought I followed the above guide well enough, I guess not.
Haven't touched MySQL in awhile but I believe the problem is that you need to grant access for root. Something like "GRANT ALL ON *.* TO 'root'@'localhost';"

Quote:
So second problem is, thay machine is on my local LAN, if I type in the network address which is 192.168.100.110 for example then I get nothing. I even try just using its IP address and still cant load the home page from other machines. Am I misisng a setting or is this purely a networking issue?
You can ping the machine from other machines right? Can you see the homepage on the machine itself? Is port 80 listening on all interfaces or just on the loopback?

-twantrd
 
Old 06-22-2006, 11:53 PM   #3
LowKey
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Original Poster
Rep: Reputation: 0
I can ping across the LAN, problem is, all machines on my network share the same physical IP probably due to a NAT. So im guessing ill have to set up a static IP for that machine and some configuration to get it working to the outside world. What a pain in the ass.
 
Old 06-23-2006, 04:37 AM   #4
ade336
LQ Newbie
 
Registered: Oct 2005
Posts: 19

Rep: Reputation: 0
try using this http://appservnetwork.com...easy,stable and also can be compile with oracle and others third party software...it's consist almost of ur requirement such as mysql and php depend on ur application...http://appservnetwork.com
 
Old 06-23-2006, 07:19 PM   #5
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Quote:
I can ping across the LAN, problem is, all machines on my network share the same physical IP probably due to a NAT. So im guessing ill have to set up a static IP for that machine and some configuration to get it working to the outside world. What a pain in the ass.
Ahh, ok. No, it's actually pretty simple. I have the same setup as you. You just need to port forward 80 on your router to your linux box's IP address. Yes, I would suggest making a static ip for your linux box.

-twantrd
 
Old 06-24-2006, 01:07 AM   #6
LowKey
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Ok so I set my router to forward port 80 on the network IP 192.168.X.X and it doesnt work. The connection is alive as I can ping it from this machine. If I switch machines and go to localhost on that machine it works. Is it an apache setting or something I am missing?

Also this cant be very safe, If someone port sniffs me how save will my web server be?
 
Old 06-24-2006, 02:38 PM   #7
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Quote:
Ok so I set my router to forward port 80 on the network IP 192.168.X.X and it doesnt work. The connection is alive as I can ping it from this machine. If I switch machines and go to localhost on that machine it works. Is it an apache setting or something I am missing?
Wait, can you hit the webserver (not ping but telnet port 80) from other machines in the LAN?? If you those machines can't, check if apache is setup to listen on all interfaces.

Quote:
Also this cant be very safe, If someone port sniffs me how save will my web server be?
If someone port sniffs, they'll see that 80 is open. And it NEEDS to be open so that other machines can establish a socket connection. You run services and these services need ports to be open to allow communication. If you want your box secure, turn off all unnecessary services, keep up to date with all software patches, make sure passwords are all very strict, write scripts to monitor your log files, etc...

-twantrd
 
Old 06-24-2006, 03:54 PM   #8
LowKey
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Original Poster
Rep: Reputation: 0
No telnet cant connect to the network id at port 80. But I mean I dont want telnet to be able to connect to that machine as thats unsafe, id rather SSH into it with a free ssh client. I dont know how to do that yet but ill figure it out im sure lol. So maybe apache isnt listening properly??
 
Old 06-24-2006, 06:39 PM   #9
LowKey
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Ok so this is the most complicated crap ever. I never would have dreamed setting up a web server would be this time consuming and this problematic on Linux. When I did this on windows an hour max and Id be running on the web, this is week 2 now and still no progress. Im starting to think it may be easier to wipe Linux and just install windows...

So anyways I find this website: http://www.linuxhomenetworking.com/l...m#_Toc92809466

Basically my home network is a wireless router, all machines in my home get their IP's from this router. The server and my primary machine have static IP's. The router has a built in firewall and Im assumimg a NAT as all machines have the same IP for sending, and network IP's for receiving.

So that website says I have to configure virtual hosts? Doesnt say which file or where to update so im not touching a thing. Then I have to configure DNS views, jesus this is not easy...

I dont want to mess anything up so can someone guide me step by step to get this working? Thaks
 
Old 06-25-2006, 05:28 AM   #10
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Quote:
No telnet cant connect to the network id at port 80. But I mean I dont want telnet to be able to connect to that machine as thats unsafe, id rather SSH into it with a free ssh client. I dont know how to do that yet but ill figure it out im sure lol. So maybe apache isnt listening properly??
telneting to port 80 is a just way of seeing if you can establish a connection onto that port. If you can't, then apache isn't set up right.

-twantrd
 
Old 06-25-2006, 06:05 AM   #11
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
Hi LowKey,

try doing an 'nmap -v <IPADDRESS>' or 'netstat -ntlp' on the webserver to see what ports are open and are being listened on. Check if port 80 is open.

If the output from nmap shows this port as 'filtered', type the command:

iptables -t filter -F

If your using a kernel prior to 2.4 you'll need to flush your firewall rules with the 'ipchains' command instead.

If the 80 port is open and unfiltered then there is likely a problem in your DNAT configuration on the network router (port redirection is not working)

You shouldn't need to setup virtual hosts. This is unlikely to solve the problem. But if you want to try anyway it is setup in the /etc/httpd/conf/httpd.conf (examples given at the end of this file).

Best of luck

Last edited by SlackDaemon; 06-25-2006 at 06:07 AM.
 
Old 06-25-2006, 06:30 AM   #12
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Quote:
Originally Posted by LowKey
Ok so I set my router to forward port 80 on the network IP 192.168.X.X and it doesnt work. The connection is alive as I can ping it from this machine. If I switch machines and go to localhost on that machine it works. Is it an apache setting or something I am missing?

Also this cant be very safe, If someone port sniffs me how save will my web server be?
This comes up a lot. If you can view the web pages from boxes on the lan then the install is fine. You will not be able to view the web pages using your public ip because there is no loop back implemented. In order to check whether the site is visible from the internet you need to ask someone on a different public ip to access the site or you need to set your browser to use a proxy webserver so that requests appear to be comming from a different ip address.
If you are going to make a server publicly accessable than make sure you have the proper security in place. There are very good guides in the Security section of LQ. Basics are;
1. Have a firewall.
2. Unless you really need public access via ssh don not have anything but port 80 being forwarded.
3. If you are running php/mysql applications look at using mod-security filters to protect you.
4. Ensure that your mail transport agent (postfix, sendmail or whatever) is not a public relay.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set up a web server? txprogrammer Linux - Newbie 6 08-26-2005 07:47 AM
how to set up a web server?? snakeo2 Linux - Newbie 12 07-07-2004 10:14 PM
how to set up a web server sameermanagoli Linux - General 1 06-26-2003 09:35 PM
How to set up a web server with pc Z28kid Linux - Newbie 13 01-16-2003 10:13 AM
Set up Web Server? lax2sman Linux - Newbie 3 02-11-2002 11:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration