LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Remote setup of LAMP server on CentOS 5 (https://www.linuxquestions.org/questions/linux-server-73/remote-setup-of-lamp-server-on-centos-5-a-612450/)

satimis 01-09-2008 06:06 PM

Remote setup of LAMP server on CentOS 5
 
Hi folks,


Ubuntu 7.04 server amd64 (Host OS) - Fluxbox desktop
CentOS 5 x86_64 (Guest OS) - w/o desktop. X is running
UMWare - Virtualization platform
Open-ssh server and client are running on both OSs


I need to setup LAMP server on CentOS 5 remotely on Ubuntu. I have been googling a while for relevant documentation and howto with many output generated. Most of them are for Windows server. Please shed me somelight where can I find a relevant document/howto for my use. TIA



Edit:

1)
TWM - a lightweight desktop is running on CentOS 5

2)
httpd.x86_64 2.2.3-11.el5.centos installed
mysql-server.x86_64 5.0.22-2.2.el5_1.1 installed
php.x86_64 5.1.6-15.el5 installed
php-mysql.x86_64 5.1.6-15.el5 installed

have been installed on CentOS 5


B.R.
satimis

trickykid 01-10-2008 04:45 PM

So they're installed. If you have ssh access, just login and configure them to your liking. I'm not sure what exactly your asking for. Any docs that tell you what commands to run will do the job most likely. The client you're connecting from really plays no factor in setting up LAMP on the CentOS server.

satimis 01-11-2008 05:38 AM

Quote:

Originally Posted by trickykid (Post 3018290)
So they're installed. If you have ssh access, just login and configure them to your liking. I'm not sure what exactly your asking for. Any docs that tell you what commands to run will do the job most likely. The client you're connecting from really plays no factor in setting up LAMP on the CentOS server.

Hi trickykid,


Previously I mistakenly thought it'll complicate to setup remote-access for configuring the remote server. X forwarding will be needed. Later I found out only with

$ ssh remote_server_ipaddr.


and login. That is all. Then I can configure CentOS 5 on Ubuntu console.


I haven't figured out how to sent/receive mails on Mail Server running on CentOS if only having one IP address from ISP and one domain. Any advice. TIA


Edit:

Network connection;

Server -> Router -> DSL Modem -> Internet

The router is on loan from ISP. They use it as gateway. I can't touch it.

Intranet IP address (router ip addr)
Ubuntu - 192.168.0.10
CentOS - 172.16.103.128 ( found with ifconfig)

Only one NIC on the PC


B.R.
satimis

trickykid 01-11-2008 09:54 AM

Quote:

Originally Posted by satimis (Post 3018856)
I haven't figured out how to sent/receive mails on Mail Server running on CentOS if only having one IP address from ISP and one domain. Any advice. TIA


Edit:

Network connection;

Server -> Router -> DSL Modem -> Internet

The router is on loan from ISP. They use it as gateway. I can't touch it.

Intranet IP address (router ip addr)
Ubuntu - 192.168.0.10
CentOS - 172.16.103.128 ( found with ifconfig)

Only one NIC on the PC

You only need one IP for a mail server and you don't necessarily need two mail servers. Pick the MTA you want to go with and go from there. Most will come standard with Sendmail, but if you want to make your life easier, I'd say pull down the postfix packages if they're not already installed and use that. I even have a quick entry on my technical blog on how to switch the default MTA in Redhat/CentOS servers:

http://clockwatching.net/~drew/blog/...y071011-080000

But choose the one your most comfortable with and read up on how to configure it. And since you're behind a router that most likely has the public IP address, you'll need to configure it to forward all the appropriate port requests to the server, like 25 to it for Mail, 80 for web, etc.

satimis 01-11-2008 10:55 PM

Quote:

Originally Posted by trickykid (Post 3019057)
You only need one IP for a mail server and you don't necessarily need two mail servers. Pick the MTA you want to go with and go from there. Most will come standard with Sendmail, but if you want to make your life easier, I'd say pull down the postfix packages if they're not already installed and use that. I even have a quick entry on my technical blog on how to switch the default MTA in Redhat/CentOS servers:

http://clockwatching.net/~drew/blog/...y071011-080000

But choose the one your most comfortable with and read up on how to configure it. And since you're behind a router that most likely has the public IP address, you'll need to configure it to forward all the appropriate port requests to the server, like 25 to it for Mail, 80 for web, etc.

Thanks for your advice and URL


No, I won't run 2 Mail Servers. I'll stop Postfix on Ubuntu and run Sendmail on CentOS
(Remark: This is a test)

# yum list postfix
Code:

Loading "installonlyn" plugin
Setting up repositories
extras                    100% |=========================| 1.1 kB    00:00   
updates                  100% |=========================|  951 B    00:00   
base                      100% |=========================| 1.1 kB    00:00   
addons                    100% |=========================|  951 B    00:00   
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 108 kB    00:00   
################################################## 215/215
Available Packages
postfix.x86_64                          2:2.3.3-2              base           
[root@localhost ~]# yum list sendmail
Loading "installonlyn" plugin
Setting up repositories
Reading repository metadata in from local files
Installed Packages
sendmail.x86_64                          8.13.8-2.el5          installed


# ps aux | grep sendmail
Code:

root      2271  0.0  0.4  66828  2068 ?        Ss  04:14  0:00 sendmail: accep
ting connections
smmsp    2280  0.0  0.3  57576  1764 ?        Ss  04:14  0:00 sendmail: Queue
 runner@01:00:00 for /var/spool/clientmqueue
root      2886  0.0  0.1  61112  704 pts/0    R+  04:30  0:00 grep sendmail


# /etc/init.d/sendmail status
Code:

sendmail (pid 2280 2271) is running...

I further found follows;

1)
On CentOS Apache is already running;

https://localhost

starts "Apache 2 Test Page
powered byt Cent OS"



2)
On Ubuntu

$ ifconfig
Code:

On Ubuntu I further found on running "ifconfig" ;
......
vmnet1 Link encap:Ethernet HWaddr 00:50:56:C0:00:01
inet addr:172.16.59.1 Bcast:172.16.59.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

vmnet8 Link encap:Ethernet HWaddr 00:50:56:C0:00:08
inet addr:172.16.103.1 Bcast:172.16.103.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


3)
On CentOS
# ifconfig
Code:

eth0      Link encap:Ethernet  HWaddr 00:0C:29:1D:65:AD 
          inet addr:172.16.103.128  Bcast:172.16.103.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe1d:65ad/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:81 errors:0 dropped:0 overruns:0 frame:0
          TX packets:100 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9632 (9.4 KiB)  TX bytes:15868 (15.4 KiB)
          Base address:0x1070 Memory:ec820000-ec840000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:74 errors:0 dropped:0 overruns:0 frame:0
          TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:19072 (18.6 KiB)  TX bytes:19072 (18.6 KiB)


4)
I found following on the Notes taken down during installing VMWare Server running "vmware-config.pl";
Code:

.....
Configuring a bridged network for vmnet0.

The following bridged networks have been defined:

. vmnet0 is bridged to eth0

All your ethernet interfaces are already bridged.

Do you want to be able to use NAT networking in your virtual machines? (yes/no)
[yes] [Enter]

Configuring a NAT network for vmnet8.

Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes] [Enter]

Probing for an unused private subnet (this can take some time)...

The subnet 192.168.213.0/255.255.255.0 appears to be unused.

The following NAT networks have been defined:

. vmnet8 is a NAT network on private subnet 192.168.213.0.

Do you wish to configure another NAT network? (yes/no) [no] [Enter]

Do you want to be able to use host-only networking in your virtual machines?
[yes] [Enter]

Configuring a host-only network for vmnet1.

Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes] [Enter]

Probing for an unused private subnet (this can take some time)...

The subnet 172.16.77.0/255.255.255.0 appears to be unused.

The following host-only networks have been defined:

. vmnet1 is a host-only network on private subnet 172.16.77.0.

Do you wish to configure another host-only network? (yes/no) [no] [enter]

......
The module loads perfectly in the running kernel.

Please specify a port for remote console connections to use [902] [Enter]

....
Generating SSL Server Certificate

In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines] [Enter]

The path "/var/lib/vmware/Virtual Machines" does not exist currently. This
program is going to create it, including needed parent directories. Is this
what you want? [yes] [Enter]
....


Now, CentOS can get out but no body can get in.


Any advice? TIA



satimis

JT_DeLaHoya 01-28-2008 11:55 PM

NAT vs. Bridge
 
>> Now, CentOS can get out but no body can get in.


>> Any advice? TIA
-----
The issue on your CentOS why you "can't get in" is because you are using NAT on your CentOS VMware Guest. You can either configure routing for this to work or you could change to Bridge mode which means that CentOS will show up as a host on the 192 network.

With regards to setting up Sendmail on CentOS. Have a look at this article by Stuart R. Kirk which I found useful.
http://www.redhat.com/magazine/025no...ail/index.html

HTH.

satimis 01-29-2008 01:03 AM

Quote:

Originally Posted by JT_DeLaHoya (Post 3038421)
>> Now, CentOS can get out but no body can get in.


>> Any advice? TIA
-----
The issue on your CentOS why you "can't get in" is because you are using NAT on your CentOS VMware Guest. You can either configure routing for this to work or you could change to Bridge mode which means that CentOS will show up as a host on the 192 network.

I use "bridged" connection.


On CentOS I can ping
192.168.0.10 (Ubuntu IP)
192.168.0.1 (router IP/gateway)
public IP of the Ubuntu



On Ubuntu I can ping
192.168.0.20 (CentOS IP)

on browser (running on Ubuntu)
https://public_IP:8080
can't display Apache 2 Test Page powered by CentOS

Port 8080 is forward to 192.168.0.20


Quote:

With regards to setting up Sendmail on CentOS. Have a look at this article by Stuart R. Kirk which I found useful.
http://www.redhat.com/magazine/025no...ail/index.html
Thanks for your URL. I haven't configured CentOS yet.



B.R.
satimis

billymayday 01-29-2008 01:06 AM

Satimis, sisnce you made so many posts getting Postfix working, why don't you stick with Postfix rather than Sendmail?

satimis 01-29-2008 01:49 AM

Quote:

Originally Posted by billymayday (Post 3038473)
Satimis, sisnce you made so many posts getting Postfix working, why don't you stick with Postfix rather than Sendmail?

I'm NOT prepared to run Sendmail on CentOS 5. Since it is the default Mailer of CentOS it just comes in on running CentOS 5.


My immediate need is to make CentOS visited by Internet, NOT single way traffic. There must be somewhere blocking the incoming traffic to CentOS. It is NOT the iptables on Ubuntu. Also I can ssh connect CentOS on Ubuntu as well as on other PCs on the same network. I can ping CentOS IP on other PCs on the same network w/o packet loss


satimis

JT_DeLaHoya 01-29-2008 02:13 AM

NAT vs. Bridge
 
Quote:

eth0 Link encap:Ethernet HWaddr 00:0C:29:1D:65:AD
inet addr:172.16.103.128 Bcast:172.16.103.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe1d:65ad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:81 errors:0 dropped:0 overruns:0 frame:0
TX packets:100 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9632 (9.4 KiB) TX bytes:15868 (15.4 KiB)
Base address:0x1070 Memory:ec820000-ec840000
The above is the information that you provided before. But I guess you have changed the config so you now have CentOS in bridged mode, good start.

You say that you can not access via https, how about http? Because if you can ping it, surely this has to do with something else. Are you able to https or http to 192.168.0.20 from your ubuntu machine? If this works, I recommend that you try the connection from 'out side' your internal network as you probably have routing issues.

HTH

/JT

billymayday 01-29-2008 02:33 AM

Do you have iptables running - it starts by default on a new CentOS build. Try
Code:

service iptables stop
and see if you can receive then.

Hint - when you install postfix, make sure you install system-switch-mail and run it to set the necessary variables

billymayday 01-29-2008 02:33 AM

Do you have iptables running - it starts by default on a new CentOS build. Try
Code:

service iptables stop
and see if you can receive then.

Hint - when you install postfix, make sure you install system-switch-mail and run it to set the necessary variables

satimis 01-29-2008 02:36 AM

Quote:

Originally Posted by JT_DeLaHoya (Post 3038516)
The above is the information that you provided before. But I guess you have changed the config so you now have CentOS in bridged mode, good start.

Oh, sorry. I changed it to bridged connection sometimes later.


Quote:

You say that you can not access via https, how about http?
No, the same. Tried many times.


Quote:

Are you able to https or http to 192.168.0.20 from your ubuntu machine? If this works, I recommend that you try the connection from 'out side' your internal network as you probably have routing issues.
No, both NOT work.

I also tried on proxydom.com http/https://public_ip:8080 without solution.


A further thought. The router is provided by ISP with password locked. I can't touch it. I made request to ISP to have port 8080 forward to 192.168.0.20 (CentOS IP addr). I double-checked it with ISP for sure. Would the router has web-base interface item on port? If YES, must I request ISP to have it enabled? Thanks


satimis

JT_DeLaHoya 01-29-2008 02:50 AM

Quote:

Oh, sorry. I changed it to bridged connection sometimes later.

No, the same. Tried many times.

No, both NOT work.

I also tried on proxydom.com http/https://public_ip:8080 without solution.

A further thought. The router is provided by ISP with password locked. I can't touch it. I made request to ISP to have port 8080 forward to 192.168.0.20 (CentOS IP addr). I double-checked it with ISP for sure. Would the router has web-base interface item on port? If YES, must I request ISP to have it enabled? Thanks

satimis
This sounds like it is something else. As you can not access the CentOS from Ubuntu even if they physically reside on the same machine it does not have anything to do with your ISP.

Is the firewall turned on on your CentOS? If it is, please turn it off during testing or let through TCP 80 & 443 for http/https access.

Is the apache listening on 80 and 443? Confirm this using:
netstat -an | grep 80
and
netstat -an | grep 443

If it isn't listening. Try restarting/starting apache

/etc/init.d/httpd restart

If you still have no luck....

Confirm that you see something like Listen 80 and Listen 443 in your /etc/httpd/conf/httpd.conf

the 443 might also have been configured in your ssl.conf.


HTH

satimis 01-29-2008 02:55 AM

Quote:

Originally Posted by billymayday (Post 3038530)
Do you have iptables running - it starts by default on a new CentOS build. Try
Code:

service iptables stop
and see if you can receive then.

Sorry I tried it before without improvement. After stopping iptables I http/https: public_ip:8080 on local network as well as another network.


Quote:

Hint - when you install postfix, make sure you install system-switch-mail and run it to set the necessary variables
I can't find system-switch-mail on Ubuntu repo.

Nor can I find it on Ubuntu postfix;

$ cat /etc/postfix/main.cf | grep switch
No printout


satimis


All times are GMT -5. The time now is 04:01 AM.