My Server setup help

Discussion in 'Server Operation' started by kingpin393, May 14, 2008.

  1. kingpin393

    kingpin393 New Member

    Hi,

    I am fairly new to Linux. I have setup Ubuntu to be used as a dedicated server. What is mostly confusing me is how exactly to get everything I need to 'work' together.

    I have a dynamic ip so I am going to get an account with dyndns (call it example.homeip.net)

    I have a linux usergroup that contains all the users I want to be able to access the various server functions.

    The best way for me to ask my question is to explain what I want:

    - A subversion repository I can access via svn.example.homeip.net (this uses the Linux usergroup for authentication)
    - Apache webserver with 2 virtual hosts:
    ---- internal.example.homeip.net (this will be the 'intranet' so it will be password protected - Linux users)
    ---- test.example.homeip.net (this will be a sort of scratch pad for testing websites.
    - mySQL server accessible by sql.example.homeip.net
    - FTP server that has :
    ---- access to the home folder for each linux user
    ---- access to internal.example.homeip.net's files
    ---- access to test.example.homeip.net's files

    First of all - I want to ask if what I want is even possible!
    If it is, how do I even begin to go about learning how to do all this and setting it up. What do I all need to do it (a DNS server)?

    If it is not possible or way too complex what alternatives do I have?

    The main thing I want to stress is I want the username and password for each user stored in only 1 place (the Linux users database). If I create a new user I do not want to update 10 config files with that new user and their password. When I create a new Linux user it would be nice to have the new user immediately be able to access the svn repo or the ftp.

    Any help or suggestions would be greatly appreciated. If there is any clarification needed let me know!

    Thanks!

    Kevin
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Should be possible. First of all, I'd set up an internal DNS server so that your internal hostnames can be resolved by the client PCs in your LAN. This tutorial might be of interest, if you want to use BIND: http://www.howtoforge.com/traditional_dns_howto
    We also have some MyDNS tutorials if you prefer a DNS server that uses a MySQL database.

    Afterwards, we can continue step by step.
     
  3. kingpin393

    kingpin393 New Member

    Thanks for your reply Falko.

    I will read your tutorials and setup those internal hostnames.

    Kevin
     
  4. kingpin393

    kingpin393 New Member

    Hi, been a while but I have got back to setting up my server.

    I have got to the point where I have the name server being resolved by other servers on my network (when I dig yahoo.com on a desktop I see that it is going through my server).

    I have been unable to figure out how to get internal hostnames to resolve however. I have been using example.com. When I type it into a web browser on a desktop it goes outside to example.com - to reach my web server I have to use the IP of the server.

    Any clue what I am missing?

    Also, I found that DynDns has the ability to create a wildcard alias. I can then use virtual hosts on my server to direct the alias... Is there a reason why I shouldn't be doing this? Do I really need a name server?

    Thanks,
    Kevin
     
  5. kingpin393

    kingpin393 New Member

    Update: I finally got the internal DNS server working!

    What should my next step be?

    Kevin
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Now you can set up Subversion, Apache, MySQL, and an FTP server (proftpd, vsftpd, pureftpd).

    Which distribution are you using?
     
  7. kingpin393

    kingpin393 New Member

    I am using Ubuntu Server 8.04.

    I have installed Subversion, Apache and MySQL, and proftpd.

    -Kevin
     
  8. falko

    falko Super Moderator Howtoforge Staff

  9. kingpin393

    kingpin393 New Member

    Do I setup the vhosts for just:
    internal.example.homeip.net and test.example.homeip.net?
     
  10. falko

    falko Super Moderator Howtoforge Staff

    That depends on your needs. If you just need these two vhosts, then yes.
     
  11. kingpin393

    kingpin393 New Member

    Ok I created 2 Vhosts:

    vhost file:
    Code:
    NameVirtualHost *:80
    
    <VirtualHost *:80>
    ServerName dev.example.com
    ServerAlias *.dev.example.com
    DocumentRoot /var/www/dev
    </VirtualHost>
    
    <VirtualHost *:80>
    ServerName internal.example.com
    DocumentRoot /var/www/internal
    </VirtualHost>
    
    But when I type internal.example.com or dev.example.com I get "Address Not Found" - What am I missing? Here is my dns settings:

    example.com.db:
    Code:
    $TTL 1500
    @  IN SOA server1.example.com. root (
                                 2007062703        ;serial
                                 28800             ;refresh
                                 3600              ;retry
                                 604800            ;expire
                                 38400 )           ;minimum 25 minutes
    example.com.      IN      NS      server1.example.com.
    server1	          IN      A       10.0.2.15
    example.com.      IN      MX      10    server1.example.com.
    rev.3.13.10.in-addr.arpa:
    Code:
    $TTL 1500
    @  IN SOA server1.example.com. root (
                                 2007062703        ;serial
                                 28800             ;refresh
                                 3600              ;retry
                                 604800            ;expire
                                 38400 )           ;minimum 25 minutes
    
                         IN    NS     server1.example.com.
    100                  IN    PTR    server1.example.com.
     
  12. kingpin393

    kingpin393 New Member

    Ah I see thanks, I added

    Code:
    *.example.com IN A 10.0.2.15
    so I can let apache deal with the subdomains...

    a small behavior issue: when i go to internal.example.com it goes to the proper vhost and when I go to dev.example.com it goes to the proper vhost but if I type anythingelse.example.com it goes to the dev vhost... why is this?

    -Kevin
     
  13. kingpin393

    kingpin393 New Member

    What is the best way to password protect a VHost - should I use an SSL certificate - I would like only users of a particular user group to have access to the VHost.

    Thanks,
    Kevin
     
  14. kingpin393

    kingpin393 New Member

    I see all the tutorials and articles use a password file. Is there a way to allow a linux group instead?

    I have a linux group that I want to access one vhost and another group to another vhost. The groups contain some of the same users so I don't want to create their passwords in 2 files...

    vhost1 -> kevin john erik
    vhost2 -> kevin john erik daniel james

    Does that make sense?
     
  15. kingpin393

    kingpin393 New Member

    Now how do I connect to mysql?

    mysql://example.com:3306 doesn't work...

    -Kevin
     
  16. kingpin393

    kingpin393 New Member

    yes, I had to enable networking in my.cnf

    Thanks!
     
  17. kingpin393

    kingpin393 New Member

    Ok so I think I have everything working internally...

    I have dev/svn/internal.birdstar.org resolving internally but now I want it to work from the outside...

    I own birdstar.org with 1&1 and have webspace with them. I still would like birdstar.org and www.birdstar.org to go to my webspace on their server.

    I just want dev/svn/internal.birdstar.com to go to my server. I created the proper subdomains with 1&1. Do I now just change the nameserver of them to the IP of my server at home? What port do nameservers use? (so I can port forward on my router)

    Thanks,
    Kevin
     
  18. falko

    falko Super Moderator Howtoforge Staff

    The easiest solution would be to create a record for internal.birdstar.org on 1&1's nameservers.
     
  19. kingpin393

    kingpin393 New Member

    Ok so I set the primary name server for internal.birdstar.com to my dyndns domain which forwards to my home.

    Is there any ports that need to be opened on my router or does it use port 80?

    Kevin
     
  20. falko

    falko Super Moderator Howtoforge Staff

    For DNS you must open port 53 (TCP and UDP).
     

Share This Page