LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-01-2017, 10:01 AM   #1
iaskaboutlinux
LQ Newbie
 
Registered: Jul 2017
Posts: 5

Rep: Reputation: Disabled
Question How am i supposed to upload my site to my web server?


Hello here is my situation:
I used linux as a desktop OS and played around with it for some time but still consider myself quite the newbie. I have this old PC a friend of mine gave me (old office computer he was throwing it away) and I decided to make it a web server. I used this guide: https://www.howtoforge.com/perfect-s...ot-ispconfig-3 and everything went fine the problem is I don't really know how am i supposed to get my files(site/s) on the server. I guess my question is more of an asking if there is any way someone could give me some documentation/guide on how am i supposed to put my site on the server and make it accessible for everybody in the world as I have tried to find what I am asking of but did not accomplish that.
 
Old 07-01-2017, 10:33 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
so this server is on your new used PC and it is a working server? Linux - with LAMP and you can ping to it or pull of that index.htm(l) page? did you set up ftp to it, or now days sftp?
give yourself access to the dir structure to ftp -> www-page-sight-dir

to make it open to the world you got a register an IP Name and get an IP Address attached to it, about aprox $19.99 go daddy dot com/mo-maybe year --

if you got say cable internet you got a router you can give it a static IP and set up a name server on your box and give out your Name to your IP to it.

Last edited by BW-userx; 07-01-2017 at 10:39 AM.
 
1 members found this post helpful.
Old 07-01-2017, 07:18 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,257
Blog Entries: 28

Rep: Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119
FTP is the classic method for uploading files to a webserver, but, if this machine is in on your home server, you could also use a thumb drive and sneakernet or even just scp them across your network.

You might also want to check the terms of service from your ISP. Many ISPs here in the USA prohibit public-facing servers, including DNS servers, on home accounts on anything less than a business-level account. Some, such as mine, even block port 80.

Oh, and welcome to LQ!

Last edited by frankbell; 07-01-2017 at 08:10 PM.
 
1 members found this post helpful.
Old 07-01-2017, 08:19 PM   #4
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
WELCOME to LQ! Sounds like you are doing GREAT on this learning project!

Here's a TMI link on the 1st step: public vs. private IP addressing, so I&ALL can reach YOU!
(from this web-search: beginner|tutorial linux server on public internet)

#0 is Security, but since it's a "throw-away", just erase&reload, if/when hack-bots break in (in 1 minute? )

#2 is putting "your stuff" into server "DocumentRoot" etc; a link here (TMI again, sorry)
Note that this depends on your "Wheezy; Apache2" (from your ispconfig link, tho it doesn't handle uploading; this 2007 book, p.89 shows /var/www/web1/web BUT 'fwiw ymmv Idk')
There's tons of doc. on this, so some patient web-research study may be needed here.
*?>Maybe other LQ'ers can provide (a link to) SIMPLE specifics, *based on* OP's link!

I'll stop rambling here, and wait to hear back, on how things are going (or specific question). Best wishes!

Last edited by Jjanel; 07-02-2017 at 03:47 AM.
 
1 members found this post helpful.
Old 07-01-2017, 08:30 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,257
Blog Entries: 28

Rep: Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119Reputation: 6119
As an aside, I used to self-host, when I had an ISP that did not block port 80. Their TOS prohibited "web hosting services" for home accounts, but did not specifically prohibit public-facing servers, and I was such a small fry I'm sure they never noticed me. (My plan was that, if they ever called me on it, I'd claim misunderstanding even as I pulled my site, but they never called me on it.)

I used noip.com for my DNS, first with a free account and later with a paid account that included domain registration.

I did not have to worry about uploading files to my web server. I created and edited them directly on my web server as I sat at my desk in the guest room.

There are ways of getting around port 80's being blocked, but my opinion is that, if your ISP is serious about blocking port 80, they are likely serious about enforcing their TOS.

Self-hosting is what got me started with Linux and Slackware. It was a marvelous learning experience.

Last edited by frankbell; 07-01-2017 at 08:40 PM.
 
3 members found this post helpful.
Old 07-02-2017, 04:46 AM   #6
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
I also use no-ip with a free account for my home web server. It's great as long as you're small fry or you're just using it for personal learning purposes.

But my ISP provider does block port 80, so I have my home web server on different ports. This means setting up apache on one (or more) custom ports and the web address is something like http://isaackuo.no-ip.org:8880/ (notice the :8880 for the custom port).

I agree with the idea of editing the files directly on the web server IF you don't mind accidentally breaking your site from the occasional "oops" moment. It's nice and fast to get immediate feedback on whether your changes are doing what you want. Just make sure to use something like "rsync" to regularly make backups before changes.

To set this up, your basic strategy is:

1) Set up /var/www as a share for your client machine to directly access on the local network. If your client machine is linux, set up an nfs share. If your client machine is Windows, set up a samba share.

2) Change the owner of /var/www to the user your client machine uses. Some people may disagree about doing this, but IMHO it's simple and elegant and just works.

3) Remember to make regular backups, at least before you make changes. rsync can be a great tool for updating a backup that only copies over the changed files. This is great because it makes the backup super fast, and also because it helps you see exactly which files were changed.

Another issue, though is making your web server accessible to the outside world. Something like "no-ip" is great for assigning your public facing ip address (google "what is my ip" for this) to a user friendly url. However, assuming you're using a router you still need something more to make the last hop.

Basically, when someone hits your public facing IP address, it doesn't directly hit any of your computers. It will hit your router (assuming you have a router). By default, the router will just eat these packets rather than forwarding them anywhere. By default, it only forwards packets that are responses to stuff the internal computers requested. In particular, when an internal computer sends out an HTTP web request, the response is routed by the router to the internal computer which sent the request.

So, when an incoming HTTP web request hits the router, the router needs to be configured to forward that request to your web server. There isn't one standard way to configure this. It will depend on the model of router. But the basic steps are:

1) Determine a good static IP address to use for your web server. You'll have to go to the router configuration tool and determine what range of IP addresses are used for DHCP. You want to use a static IP address which is NOT in this range, but still with the same first three numbers. For example, the range might be 192.168.1.50 to 192.168.1.200; in that case you want maybe 192.168.1.25. Also, the static IP address can't be the same as the router's address.

2) Set up the web server to use this static IP address. You can edit /etc/network/interfaces, and create (or modify) an entry similar to this:

Code:
auto enp9s0
iface enp9s0 inet static
address 192.168.1.25
netmask 255.255.255.0
gateway 192.168.1.1
You use the router's IP address for "gateway". You can determine what to name the network device with the command:
Code:
ip addr list
After doing this, you can make the new setting take by using:
Code:
ifdown enp9s0; ifup enp9s0
Note that this will definitely break your remote connection if you're remoted in, and if you flubbed /etc/network/interfaces you won't be able to remote in again to fix it. Therefore, I suggest you only do this if you're physically logged in to the machine.

3) Set up port forwarding on the router to forward TCP requests to port 80 to the web server's internal static IP address. The exact way to do this will depend on your model of router.
 
2 members found this post helpful.
Old 07-03-2017, 01:26 AM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,141

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Are you able to access your website locally?

What I mean within your local network, is it accessible?

So, if everything is working locally then it's time to go public. I suppose you have a home router and no firewall.

Make sure also that security settings and configurations are properly set and no script kiddies can play at your web server.


In your router you need to setup port forwarding to your Linux box, what you need is the local static IP address of your Linux box.

Port forward port 80 to your Linux box, if you need FTP, email or other configuration you will need the desired port to be forwarded.

But I suggest port 80 only until you get familiar with what you are doing.



Once port 80 is open to the external world and your Linux box is ready to be hacked (if your web server is not properly configured).

Check what's your Public IP Address, then ask a friend or you can test it yourself. If you have a data plan in your mobile phone, disconnect your Wi-Fi and test it from your phone.

Test it like this, open a browser and in the address bar: http://my.public.ip.address

If you're happy and everything works well, then you can buy a domain like http://www.hack_at_your_own_demise.com


Good luck, don't go live if you're not sure with your security configurations.
 
1 members found this post helpful.
Old 07-03-2017, 01:35 AM   #8
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
ispconfig3 is a full-featured server control panel. I use it myself for sites, both on internal development servers and cloud servers. However, it's a complex system and you should spend time learning and understanding the various settings and options in ispconfig3.

In a simple steps, you'd use the ispconfig3 web gui to create a new website. This will normally create a directory under /var/www/<new website> and in that directory there is a /web subdirectory. This is where your web files go.

I normally create a shell account for each new website, then you can ssh/scp directly to your new site using the site shell account username to connect. ispc3 includes an ftp server setup, but personally I don't use ftp so I never enable the ispc3 ftp server.

Once you copy your web files into your site directory, you should be able to open your new website with your browser.

For internal use, you need to do something about dns name resolution. For myself, I set up a dnsmasq internal dns server that handles local (non-public dns) names.

As far as public internet access, you need a doman name that will resolve to your system public internet ip. Use either dynamic dns or a fixed ip (if your isp offers one). Then you'll have to do some tweaking if your existing internet uses a router. Back when I ran ispconfig3 behind a router on a public connection, it mostly involved setting the appropriate port forwards in the router.

Last edited by Doug G; 07-03-2017 at 01:38 AM.
 
1 members found this post helpful.
Old 07-03-2017, 07:19 AM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Oh btw I just thought of this last night, it is called Webmin a sweet little program to configure and setup and admin your Apache web server.

Quote:
Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more.
Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you
manage a system from the console or remotely.
 
1 members found this post helpful.
Old 07-03-2017, 07:24 AM   #10
iaskaboutlinux
LQ Newbie
 
Registered: Jul 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
First I want to say thanks for all the feedback you guys gave me. I didn't really think there would be so many people willing to help. At the moment I have a lot of work but soon I will have more free time and I will set up my server properly. Of course first I'll have to go through all your replies to get the needed knowledge. Anyways Thank You All again and the next time I will post hopefully will be after I have configured everything decently. Cheers!

Last edited by iaskaboutlinux; 07-03-2017 at 07:28 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
block particular web site form multiple site hosted web server and allow others lasantha Linux - Security 1 08-17-2010 12:09 PM
What are the steps to upload my web site umwai Linux - Server 4 03-03-2009 12:54 AM
I want to upload a file to some place so others can see it (a whole web site ) rob.rice General 4 01-29-2009 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration