Remote setup of LAMP server on CentOS 5

Discussion in 'Server Operation' started by satimis, Jan 10, 2008.

  1. satimis

    satimis Member

    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


    B.R.
    satimis
     
  2. falko

    falko Super Moderator Howtoforge Staff

    How do you mean that? Do you want to log in on your CentOS server from your Ubuntu desktop using SSH? You can do it like this:

    Code:
    ssh username@hostname
     
  3. satimis

    satimis Member

    Hi falko,


    Thanks for your advice.

    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. (CentOS 5)


    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


    satimis
     
    Last edited: Jan 11, 2008
  4. falko

    falko Super Moderator Howtoforge Staff

    You mean you want to receive emails on both the Ubuntu and then CentOS system? That's not possible with just one public IP address.
     
  5. satimis

    satimis Member

    No, with one public IP I will stop postfix on Ubuntu running and running sendmail (default mail package) on CentOS as mail server. I haven't figured out to make the World connet CentOS. Now CentOS can reach the outside world BUT NOT vice versa.

    It is my first time running virtualization. This is an experiment. I want to find out what will be its advantage running serveral servers on the same PC.


    Another thought if with 2 public IP can I make both Ubuntu and CentOS systems receive emails? OR in addition I need another domain or matching domain?

    Thanks


    satimis
     
  6. falko

    falko Super Moderator Howtoforge Staff

    You must forward all desired ports from your router to your CentOS system.

    You need a router that can deal with multiple public IP addresses.
     
  7. satimis

    satimis Member

    This is really a problem to me. I requested ISP to forward port 8080 to 192.168.0.20 (CentOS IP addr). The router is on loan from ISP. I can't touch it except ISP. I reconfirmed my request with ISP. Now CentOS can connect Internet. But Internet can't get in CentOS. I'm running bridged connection. CentOS and Ubuntu (Host OS) are sharing ONE NIC. I have tried 2 days w/o a solution. Any advice? Where I have to check to fix the problem?


    Shopping a router able handling multiple public IP? OR under other technical term/name?


    B.R.
    satimis
     
  8. satimis

    satimis Member

    Hi folks,


    I have been fiddling around to get CentOS, the guest OS on VMware server, to be visible by Internet without result.


    Now I can run;

    either
    http://192.168.0.20 (CentOS IP addr)

    or
    https://192.168.0.20


    on Ubuntu, the host OS, OR another PC on the network to display "Apache2 Test Page powered by CentOS".


    But on another network (tried proxydom.com), none of;

    http://public_ip:8080 (port 8080 is forwarded to 192.168.0.20)
    https://public_ip:8080

    can visit "Apache 2 Test Page"


    On proxydom.com

    https://public_IP (displays Apache default page of Ubuntu)
    https://public_IP:80 (nothing found)
    https://public_IP:443 (displays Apache default page of Ubuntu)
    https://public_IP:8080 (nothing found)


    http://public_IP (displays Apache default page of Ubuntu)
    http://public_IP:80 (displays Apache default page of Ubuntu)
    https://public_IP:443 (directed to "http://proxydom.com/proxy.php?q=http%3A%2F%2Fsatimis.com%3A443&hl=222" with nothing displayed)
    https://public_IP:8080 (nothing found)


    Help would be appreciated. TIA


    satimis
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Does your router forward port 8080 to port 80 on 192.168.0.20?
     
  10. satimis

    satimis Member

    Whether you meant forward port 8080 to port 80 then to 192.168.0.20 ?

    Or forward port 80 and port 8080 to 192.168.0.20 respectively?


    Contacted ISP about half hour ago in re of the router problem which is under their remote control. They made following 2 settings;


    1)
    Forward ports 80, 443 and 8080 all to 192.168.0.20 (CentOS IP addr.)

    Appache default page of CentOS can be visited with;

    http://public-ip


    The problem on Ubuntu is SquirrelMail, the webmail, unable to work.


    2)
    Set CentOS IP addr, 192.168.0.20 to DMZ.

    Appache default page of CentOS can be visited with;

    http://public-ip


    But all ports forward to CentOS. The Mail Server on Ubuntu can't work.


    Any solution to Setting 1) above so that SM can work with all www ports forward to 192.168.0.20, CentOS? TIA


    B.R.
    satimis
     
  11. falko

    falko Super Moderator Howtoforge Staff

    Port 8080 must be forwarded to port 80 on your CentOS server, and port 80 must be forwarded to port 80 on your Ubuntu server.
     
  12. satimis

    satimis Member

    Hi falko,


    I suppose your advice to be done on the router (Linksy) which is password-locked by ISP. I can't touch it.


    Steps to be performed;

    1)
    Forward ports 80, 443 and 8080 all to 192.168.0.20 (CentOS IP addr)


    2)
    On "Applications and gaming" tab - forward port 8080 to 192.168.0.10 (Ubuntu IP addr)


    3)
    On "Port Triggering" tab - translate 8080 to 80


    (Remark: port.conf of Ubuntu is listening "port 80". I'll leave other ports, other than those 3 ports mentioned above, still forwarded to 192.168.0.10 - Ubuntu IP addr)


    If I'm wrong, please correct me. I'll request ISP to make such changes.


    If your advice has to be done on httpd.conf (CentOS) and port.conf (Ubuntu) respectively. Please advise how to make them in detail. TIA


    B.R.
    satimis
     
  13. falko

    falko Super Moderator Howtoforge Staff

    You can forward one port to just one system. You can't forward port 8080 to two systems.
     
  14. satimis

    satimis Member

    Thanks for your advice.

    In my case what can I do? SquirrelMail needs web port.


    Performed following further test;
    -----------------------------------------


    Forward port 443 to CentOS, the Guest, instead of 8080. Ubuntu works on 2 www ports, 80 and 8080.


    On CentOS
    =======

    Edit /etc/httpd/conf/httpd.conf
    Add "Listen 443" and comment out;
    Listen 80
    Listen 8080


    # service httpd start
    Code:
    Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:443
    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
    no listening sockets available, shutting down
    Unable to open logs
    
    The fix is as follow;

    Edit /etc/httpd/conf.d/ssl.conf
    comment out "Listen 443"
    Code:
    
    ....
    #
    # When we also provide SSL we have to listen to the
    # the HTTPS port in addition.
    #
    #Listen 443
    ...
    

    # service httpd start
    Code:
    Starting httpd:                                            [  OK  ]
    

    https://public_ip
    displays Apache default page on CentOS


    http://public_ip
    displays Apache default page on Ubuntu

    http://public_ip/mail
    starts SquirrelMail on Ubuntu


    But it needs the ssl.conf listening on port 443 - SSL httpd


    Furthermore if forwarding all www ports, 80, 443, 8080 to CentOS then leaving no www port connected to Ubuntu, SquirrelMail won't work. It is a web-base application. I'm now at dilemma.


    I can revoke all changes made. This is only a test on virtualization. I have no intention to run CentOS, the Guest, as Web server.


    I'm now at lost what will be the use or advantage to go virtualization? I can't run mail and web server on Host/Guest separately. What shall I make use of the Guest ? Only for testing? I think virtualization will only be suitable for running multiple public IPs.


    I haven't tested if w/o web port connected on Host, the Mail Server, whether I can run SquirrelMail remotely. I suppose the chance is remote. Any comment/advice? TIA



    satimis
     
    Last edited: Feb 3, 2008

Share This Page