Results 1 to 7 of 7

Thread: Apache server

  1. #1
    Join Date
    Sep 2011
    Location
    Wandering
    Beans
    75
    Distro
    Ubuntu 10.04 Lucid Lynx

    Apache server

    How do i install apache server on ubuntu 10.04 LTS using the terminal?
    Is it necessary if i want to view a page that contains html and php code?
    By installing this i would have a server on my computer?
    And finally will other users that would be connected to my network have access to my files?
    (i Just started reading about php-mysql and i'm a little confused with the use of apache )

  2. #2
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Apache server

    Apache = server, yes.

    For help installing a LAMP stack (Linux, Apache, MySql, PHP), see this page:


    https://help.ubuntu.com/community/ApacheMySQLPHP

    then copy your web files over to /var/www/ treating that as the root of the filesystem for the web.

    If you jut want to view html/php files, you could always just double-click them, and they'll open in your browser.

    You'll probably need to setup port forwarding & DNS if you want a website, but you can have a LAN server just by installing apache.
    Last edited by MG&TL; December 21st, 2011 at 10:43 AM.

  3. #3
    Join Date
    Dec 2011
    Beans
    7

    Re: Apache server

    You can also use the F1 help manual where it explains you step by step how to set up a webserver.

  4. #4
    Join Date
    Sep 2011
    Location
    Wandering
    Beans
    75
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Apache server

    Quote Originally Posted by MG&TL View Post
    then copy your web files over to /var/www/ treating that as the root of the filesystem for the web.

    If you jut want to view html/php files, you could always just double-click them, and they'll open in your browser.
    Ok, i think i managed to install the server successfully. But what files should i copy to the /var/www/ directory?
    I would also like to point out that i cannot view html/php files by double-clicking them cause when they open in my browser ( i used chrome and mozilla ) all i see is a white page!

  5. #5
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Apache server

    Then you have a problem with your html/php.

    Assume that you have one file, index.html, that points to a lot of others, "food/myfavouritecheeses.html", "rockets/SaturnVpic.html" and "logintoawesomeserver.php", you'd have a directory structure like this:

    Code:
    /var/www/:
    
    
    "index.html"
    "logintoawesomeserver.php"
    <rockets>
            "SaturnVpic.html"
    
    <food>
            "myfavouritecheeses.html"


    So treat /var/www/ as the root of the web's filesystem. So google.com's server (assuming they run apache, I don't think they do) would look a bit like this:

    Code:
    /var/www/:
    
    homepage.html
    google.png
    search.php (or something!)
    If you have a problem viewing html, try opening gedit and copy-pasting this in:

    Code:
    <html>
    
    <head>
    </head>
    
    <body>
    
    <h2>My first webpage!</h2>
    
    </body>
    </html>

    and saving it as "test.html". Then double-click on it. If it doesn't open, we can deal with that later. If it does, how have you produced your html? Did you code it, or use dreamweaver or whatever?

    No disrespect, but I think learning a little more about the web first might be a good idea. Once you can code some html for yourself, (i.e. in notepad or a text editor), star thinking about a webserver.

    I hope this helps, (I'm no expert).

  6. #6
    Join Date
    Apr 2005
    Location
    Finland/UK
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Apache server

    Quote Originally Posted by dep0 View Post
    Ok, i think i managed to install the server successfully. But what files should i copy to the /var/www/ directory?
    I would also like to point out that i cannot view html/php files by double-clicking them cause when they open in my browser ( i used chrome and mozilla ) all i see is a white page!
    You can't view a page that contains PHP code simply by double-clicking the file. The PHP code needs to be interpreted by a web server to generate the HTML code for the browser to display.

    Anyway, move whatever files you'd want to be displayed by the server into /var/www. So if you are working on a web site you'll need to move all it's files there.

    (If you are running this server for testing or development purposes, I'd usually recommend setting up a site inside your home directory isntead of the default /var/www. That makes the work much easier as you don't need to deal with permissions, and on a non-production server it doesn't have any security issues either. You can find instruvrions for configuring sites in Apache here: https://help.ubuntu.com/11.10/serverguide/C/httpd.html)

  7. #7
    Join Date
    Sep 2011
    Location
    Wandering
    Beans
    75
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Apache server

    Quote Originally Posted by MG&TL View Post
    If you have a problem viewing html, try opening gedit and copy-pasting this in:

    Code:
    <html>
    
    <head>
    </head>
    
    <body>
    
    <h2>My first webpage!</h2>
    
    </body>
    </html>

    and saving it as "test.html". Then double-click on it. If it doesn't open, we can deal with that later. If it does, how have you produced your html? Did you code it, or use dreamweaver or whatever?

    No disrespect, but I think learning a little more about the web first might be a good idea. Once you can code some html for yourself, (i.e. in notepad or a text editor), star thinking about a webserver.

    I hope this helps, (I'm no expert).
    Actually i said i have problems opening pages that contain php code. I can code a lot html on my own, but as you may know html is pretty useless without php.
    I'll try the solution mcduck recommended and see what happens.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •