0

Hello

I have designed a website (link defunct) in the past, and I have used a website hosting service. I have installed Ubuntu Server on a scrap computer, and I was wondering if there was a way to import my website files that took me so long to design, onto my Ubuntu Server. I just wanted to eliminate the hosting needs. If it helps, the website files are accessible through an FTP server.

Thanks

Thomas Ward
  • 74,764
Simon Quigley
  • 632
  • 6
  • 23

3 Answers3

2

Just install LAMP in your Ubuntu server and configure it.

Then just copy your files from the hosting server and place them in your /var/www/html directory. From there just go to http://localhost/ and you will access your site.

Parto
  • 15,325
  • 24
  • 86
  • 117
1

Yes, you definitely can, but it will depend on a few things, such as whether it uses a database. If not, it's easier.

I used to do it a lot, and I would create a virtual site in /etc/apache2/sites-enabled/000-default.conf with the same name. Then I would create an entry in /etc/hosts to redefine that name to localhost. This part isn't really necessary, but it can be convenient if there are any absolute links. Then, I'd comment out the entry in the hosts file after uploading. But you can also create whatever name you want as long as it matches the name in apache's config file.

It's been a while since I've done this, but I may have a backup somewhere if you need specifics. But the basics are to add a VirtualHost entry after the existing one, something like this:

<VirtualHost *:80>
    <Directory  /var/www/html/MYSITE>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    DocumentRoot /var/www/html/MYSITE/
    ServerName WHATEVER_YOU_WANT.X
</VirtualHost>
Marty Fried
  • 18,466
0

Ubuntu 14.04 by default serves web pages from /var/www/html/. You should be able to see "Apache2 Ubuntu Default Page" in the index.html that is there once you have installed apache2.

/etc/apache2/apache2.conf and more specifically /etc/apache2/sites-enabled/000-default.conf define the default DocumentRoot location.

The files will need to be readable by the www-data user for Apache to be able to read and serve them.

Alternatively, just drop your web pages in a directory and point your browser to it such as file:///home/your-user-name/Downloads/. This would only work until it hit an <a href> tag that is not relative.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
rcpa0
  • 594
  • Due to the same origin policy, web browsers generally prohibit the inclusion of local file system resources (file: scheme) by a web site loaded from a network resource (e. g. http: scheme), even if the web server runs on the same machine and serves files from the same file system, but the web browser cannot know that. – David Foerster Mar 27 '15 at 00:20