LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-02-2006, 09:08 AM   #1
zdienos
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Rep: Reputation: 0
Install Apache on Local Network


Hi There...

I am a newbie.
I have an pc act as router (gateway) on internet cafe.

I want to install apache as webserver to build my own webhosting.
But i want to install it on a client (192.168.0.10) on the network.

This is my network.

eth0 [Internet] 202.xxx.xxx.xxx
eth1 [Gateway] 192.168.0.254
|
|
-----------------------------------
| | |
[Client 1] [Client 2] .......... [MyClient]
192.168.0.1 192.168.0.2 192.168.0.10


Please help me....
 
Old 09-02-2006, 11:08 AM   #2
drhart4000
Member
 
Registered: Aug 2006
Distribution: Centos, Fedora, Ubuntu, Slackware
Posts: 51

Rep: Reputation: 15
Install apache on a client, then use your gateway pc to redirect port 80 to that client running Apache. Is this what you wanted?

then ofcourse to have a domain name you have to regester a dn witha company like Directnic.com and have a dns server or 3rd party dns like: ZoneEdit.com

a nice source that helped me buld my linux server was at http://diywebserver.com/linux.php

Last edited by drhart4000; 09-02-2006 at 06:50 PM.
 
Old 09-06-2006, 04:30 AM   #3
zdienos
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
I am a really
How to redirect port 80 to my client that running apache?
My server/gateway is locked by password. (linux suse 9.3)
Could I change it from my client ??


thank you
 
Old 09-06-2006, 03:54 PM   #4
drhart4000
Member
 
Registered: Aug 2006
Distribution: Centos, Fedora, Ubuntu, Slackware
Posts: 51

Rep: Reputation: 15
Try the following

Edit the /etc/rc.d/rc.firewall-iptables ruleset:
vi /etc/rc.d/rc.firewall-iptables
...and place the lines shown below just ABOVE the "FWD: Allow all connections OUT and only existing and related ones IN" line (in the "Optional FORWARD section"). Please be sure to replace the word "$EXTIP" with your specific Internet IP address.

If you have a dhcp address then uncomment the "Determine the external IP automatically" section
and comment out EXTEIP"2... under the "config" section.


Code:
#echo "Enabling PORTFW Redirection on the external LAN.."
#
#   This will forward ALL port 80 traffic from the external IP address
#   to port 80 on the 192.168.0.10 machine
#
#   Be SURE that when you add these new rules to your rc.firewall-*, you
#   add them before a direct or implict DROP or REJECT.
#
# Config. section:
# ----------------
PORTFWIP="192.168.0.10"
EXTIP="202.xxx.xxx.xxx"


# NOTE:  If you are using the basic rc.firewall-iptables ruleset, you
#        will need to enable the following EXTIP option.  Users of the
#        rc.firewall-iptables-stronger ruleset already have this defined.
#
#  *PLEASE* look over the rc.firewall-iptables-stronger ruleset for more 
#            specific issues regarding dynamic vs. static IP addresses
#
#
# Determine the external IP automatically:
# ----------------------------------------
#
#  The following line will determine your external IP address.  This
#  line is somewhat complex and confusing but it will also work for
#  all NON-English Linux distributions:
#
# DISABLED by default -- to enable, REMOVE both the "#" characters below
#
#EXTIP="`$IFCONFIG $EXTIF | $AWK \
#/$EXTIF/'{next}//{split($0,a,":");split(a[2],a," ");print a[1];exit}'`"


# Allow forwarding of new and existing port 80 connections from the external
# interface.  This rule is required as our default FORWARD policy is DENY.
#
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -p tcp --dport 80 -m state \
 --state NEW,ESTABLISHED,RELATED -j ACCEPT


#Enable PORTFW of this port 80 traffic from the external interface
#
$IPTABLES -A PREROUTING -t nat -p tcp -d $EXTIP --dport 80 -m state \ 
 --state NEW,ESTABLISHED,RELATED -j DNAT --to $PORTFWIP:80
Now save and exit:
Press ESC then wq and enter

now run /etc/rc.d/rc.firewall-iptables:
./etc/rc.d/rc.firewall-iptables

... that should do what you want.

UPDATE: if you are running dhcp you will have to run this every time you receve a new ip... this should not be a problem since, this script will run at boot time. But if your ip changed before you reboot then this would be a problem.
You just run:
./etc/rc.d/rc.firewall-iptables

Last edited by drhart4000; 09-07-2006 at 04:55 PM.
 
Old 09-07-2006, 05:32 AM   #5
zdienos
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for reply my questions..

I will try yours.... (if i using linux later....)

But my client use Mixxxft Wxxxws, what software could i should use?? (XAMPP, LiteSpeedWebServer, or Apache on Wixxxxws)

And where i start from, what are going i do then??


(my question is really newbiew...)
 
Old 09-07-2006, 03:32 PM   #6
drhart4000
Member
 
Registered: Aug 2006
Distribution: Centos, Fedora, Ubuntu, Slackware
Posts: 51

Rep: Reputation: 15
Yeah just use apache for windows. you can find it here: http://download.nextag.com/apache/ht...x86-no_ssl.msi
and heres an installation guide if you need it: http://www.ricocheting.com/server/apache.html

NOTE THAT THIS IS A LINUX FORMS SITE... LOL

so as far a windows server configuring... I can tell you but however this is a LINUX forms site.
for setting up your windows as a web server a good source would be: http://diywebserver.com
Here they go in to detail on how to accomplesh this along with other options like: mailserver, webmail, ftp,etc... so if you want to stick with windows... stick with http://diywebserver.com

But,I would recommend using linux, as every thing is open source, most software is freeware (free software), more secure, and in my experience more RELIABLE, and you have every one a LQ to help you if you have problems.
It may be a little more difficult to configure (as being a newbie) but it would be worth it.
And you can say, hey im running a linux web server
I can help you if you want a linux web server. Since you are a newbie i recomend you use Fedoracore.

and sorry i missed the server is locked up part... This should be easy to do...
just follow the following step by step:

Step 1.


Disconnect computer from the network (you will work with root privileges)

Step 2.


Boot from your first install CD and press F1 at the first screen, then choose "Rescue System" from the menu and at the prompt type:

#root


* NOTE: You do NOT need a password


Step 3.


Next at the prompt enter:

# cd /etc
# vi passwd



scroll down to the "root" line
In the passwd file look for root line (something like):

root:x:0:0:root:/root:/bin/bash


delete the "x" after "root:" leave the colons!

To delete letter under the cursor press ESC key and "x" -> so you are deleting letter "x" by pressing sequence ESC key "x"

After the modification above line shoul look like this:

root::0:0:root:/root:/bin/bash



Save file and exit:

Press ESC then wq and enter

Next edit:

# vi shadow



Press ESC then "x" (x will delete letter under cursor)
change root line from something like:

root:$2a$05$sin5i458ghsdfg8076t5ymp4y;jgslkdbvffd bshmRK:12856:0:10000::::


to

root::::


note four colons left!

Save the file:
ESC next wq

If something went wrong with editing press ESC and next q!

it is q with exclamation mark: "q!"

Step 4

reboot your computer as normal (off the HD), log in as your normal user, and from the console window enter:

$ su
# passwd




And set the new root password. Log out as root:

You just set a new root password.

if you using samba be sure to change that to your new password too:
#smbpasswd root
set your new password...


If you have lost user password: log in as a root and type

#passwd user_name
enter a new user password.



Hope this is Helpfull... Wayne Hartmann.

Last edited by drhart4000; 09-07-2006 at 05:05 PM.
 
Old 09-11-2006, 02:57 AM   #7
zdienos
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Thank u very-very much...


Now I have another quesion..

How do I change the speed of LAN/ethernet Card?

Such: 10Base TX/Half or Full Duplex...
---------------
I have install linux on all my clien with Vector Linux (dual boot with Win****s).

If I start it first from PowerButton, they will not connected.
But if I start Wind***s first, then I boot the Linux, It will connected.

I assummed that the LAN/Ethernet Card speed is not correct (my LAN speed is 10 Half Duplex in Winxxxs, it also not connected if I change the speed to "100 Half or Full Duplex" too).

Now I want to change the speed of LAN/Card on Linux.
Can U help me....???



(Sorry, my English is bad, I'am from Indonesia)
 
Old 09-14-2006, 03:30 PM   #8
drhart4000
Member
 
Registered: Aug 2006
Distribution: Centos, Fedora, Ubuntu, Slackware
Posts: 51

Rep: Reputation: 15
Enter this line in to your "/etc/sysconfig/network-script/ifcfg-eth0" (asumming your nic is eth0)
file:
Code:
ETHTOOL_OPTS="speed 10 duplex half autoneg off"
NOTE: I haven't used Vector linux before so the file location may me diffrent.

# vi /etc/sysconfig/network-script/ifcfg-eth0 (asumming your nicis eth0)
enter the line

the file should now look somthing like this:
Code:
DEVICE=eth0
IPADDR=192.168.1.10
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
ETHTOOL_OPTS="speed 10 duplex half autoneg off"
or full duplex:
Code:
DEVICE=eth0
IPADDR=192.168.1.10
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
ETHTOOL_OPTS="speed 10 duplex full autoneg off"

Next restart the network:
# /etc/init.d/network restart

That should do what you want.

Last edited by drhart4000; 09-14-2006 at 03:37 PM.
 
Old 09-16-2006, 12:17 AM   #9
zdienos
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
sorry..

I can't find it in my vector..
What should I do now??
 
Old 09-16-2006, 10:31 AM   #10
drhart4000
Member
 
Registered: Aug 2006
Distribution: Centos, Fedora, Ubuntu, Slackware
Posts: 51

Rep: Reputation: 15
OK, in vector linux... try this command.
# /sbin/vinet
that should be a utility that will do what you want... i dont know if its a gui or command line though...

sorry i wish i could be more help but i've never used Vector linux before...

but start messing around with that...

if you don't get any where with that you can try posting at:
http://www.vectorlinux.com/forum1/index.php?www
 
  


Reply



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
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM
9.2 Pro local network install slackaddict SUSE / openSUSE 7 04-01-2005 03:04 AM
apache virtual hosts: how do I view them on local network? wendallsan Linux - Software 2 01-16-2005 11:57 PM
Apache server works, but only on my local network munchies Linux - Networking 4 04-07-2004 09:18 AM
Cannot resolve local addresses on local network danielgrenyer Linux - Networking 6 01-14-2004 11:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:31 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
Open Source Consulting | Domain Registration