FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » A Question About Webhosting with Linux (Page 1)

  This topic comprises 2 pages: 1  2   
Author Topic: A Question About Webhosting with Linux
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
So I have an Ubuntu box and aside from current difficulties ssh into it I hope to host a website/domain on it, one example is hosting my own little Wiki on it for the collaborative Alternate History timeline me and King of Men are padding through in our Epic RP RTS campaign "There Will Be War" that will take us roughly 1-2 years to complete.

So basically is it possible to host something that can Have say www.somethingwhatever.su?

IP: Logged | Report this post to a Moderator
Alcon
Member
Member # 6645

 - posted      Profile for Alcon   Email Alcon         Edit/Delete Post 
What are you asking? Just if it's possible to host a domain name from your home internet connection? Yes. It is, I do it. It only costs about $15 a year too if you buy your domain name from the right place.

I wouldn't recommend using Ubuntu though. Ubuntu's an awesome desktop or laptop distro. But not the best server distro. Or at least it wasn't last I checked. Straight up Debian is generally better for web servers.

How good are you with command line linux? Are you willing to learn it? If you're not willing to learn command line, probably shouldn't start your own server. Go find a hosting site that has a nice GUI set up for you. If you're hosting a web server that uses PHP, MySQL (as wikis do), Apache, SSH, etc... you're gonna have to get pretty comfortable with the command line and with editing configuration files. If you're willing to learn it then setting up, configuring and maintaining your own web server is a great way to get comfortable with the command line. But if you're not ready to struggle through learning to command line, do it another way.

Editted to remove unnecessary snark. Man I need to fix my snark filter. Sorry Blayne, my initial post was way more harsh than need be.

Posts: 3295 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
King of Men
Member
Member # 6684

 - posted      Profile for King of Men   Email King of Men         Edit/Delete Post 
Touching ssh: I haven't tried recently, but two weeks ago I was able to ssh in just fine. It's running emacs that gives me trouble.
Posts: 10645 | Registered: Jul 2004  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
nowadays it says connection refused which puzzles me.

Ild say i spent about a year learning Unix Networking and Bash scripting from Putty, I can make bash scripts with sed, grep, and gawk.

IP: Logged | Report this post to a Moderator
Alcon
Member
Member # 6645

 - posted      Profile for Alcon   Email Alcon         Edit/Delete Post 
Nice, then you're all set for command line. It'll take you a while to learn the config files, but you oughta be able to pick em up.

As for ssh, have you checked your firewall? Are your server, your pinhole and your client all going for the same port? And is it the right ssh port (22 I think).

Posts: 3295 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
yup dlink says 22 is open but doing 'canyouseeme.org' it doesnt see it opened.
IP: Logged | Report this post to a Moderator
Alcon
Member
Member # 6645

 - posted      Profile for Alcon   Email Alcon         Edit/Delete Post 
Do you have a software firewall on your server machine? You'll have to open a hole in that as well.
Posts: 3295 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
no software firewall i know of.
IP: Logged | Report this post to a Moderator
Alcon
Member
Member # 6645

 - posted      Profile for Alcon   Email Alcon         Edit/Delete Post 
Okay, the next thing to check.

code:
ps aux | grep ssh

You should see something like:

code:
root      4968  0.0  0.1   5280   968 ?        Ss   11:13   0:00 /usr/sbin/sshd

Do you?
Posts: 3295 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
code:
ashkore 5113 0.0 0.0 4436 ? S Apr20 0.00 /usr/bin/ssh-agen


ashkore 5987 0.0 0.1 756 pts/0 R 17:57 0.00 grep ssh

k this is what I get.
IP: Logged | Report this post to a Moderator
Alcon
Member
Member # 6645

 - posted      Profile for Alcon   Email Alcon         Edit/Delete Post 
Interesting. And you're running Ubuntu? Okay I don't think you actually have the sshd (the ssh server) installed. You may have had it installed at one point, but it doesn't seem to be there any more. So here's one way to fix it. Go to Synaptic package manager and do a search for OpenSSH Server. Install it and reboot. SSH should then be working. You should see what I posted above when you ps aux | grep ssh. The sshd is the actual SSH server.

Actually another thing you could do is go to /etc/init.d. You ought to see an "ssh" there. If you do, you already have the ssh server installed, it's just not running for some reason. Try restarting. If it doesn't automatically start, just try reinstalling. There's probably a way to get it to autostart again if it's not, but I can't think of it off the top of my head. Reinstalling should do the trick and it's easier (plus it updates it for you). If it restarts on reboot you're all set. Alternately if it's there and not restarting on reboot you could just:
code:
sudo /etc/init.d/ssh start

To start it manually. And just resign yourself to manually restarting it every time you reboot.
Posts: 3295 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
sudo root get-apt install sshd?
IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
Never sudo root unless you have a really, really good reason.

If you insist on doing it from the command line, sudo apt-get install openssh-server

Or even, sudo apt-get install ssh

ssh is a metapackage for the client and server.

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
okay well I did sudo apt-get install ssh gave me no errors.


However port 22 seems to be blocked I do not know by what my router is forwarding it, it says its open but somehow its closed.

IP: Logged | Report this post to a Moderator
ricree101
Member
Member # 7749

 - posted      Profile for ricree101   Email ricree101         Edit/Delete Post 
Is the ISP blocking 22 for some reason?
Posts: 2437 | Registered: Apr 2005  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
I can't tell, by ISP you mean the company that sells us the internet? I'll call them up.
IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
According to videotron they do not block anything, theyre job is to provide internet service nothing more nothing less they do not moderate its usage beyond charging us if we go 100 gb above our limit.
IP: Logged | Report this post to a Moderator
King of Men
Member
Member # 6684

 - posted      Profile for King of Men   Email King of Men         Edit/Delete Post 
I must say, an ISP blocking 22 strikes me as a really excellent way to go out of business. No Linux user would tolerate that for a minute.

I just tried it, I'm getting the connection refused now too.

Posts: 10645 | Registered: Jul 2004  |  IP: Logged | Report this post to a Moderator
Alcon
Member
Member # 6645

 - posted      Profile for Alcon   Email Alcon         Edit/Delete Post 
Have you checked ps aux | grep ssh since you installed the ssh package? Have you restarted the system since you install the ssh package?
Posts: 3295 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
ive restarted, ill redo the cmd after calling dlink.
IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
code:
ashkore   5112  0.0  0.0  4432  540 ?        S    19:13   0:00 /usr/bin/ssh-agen
ashkore 5330 0.0 0.1 2972 752 pts/0 R 20:55 0:00 grep ssh

i get this again.
IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
quote:

ashkore@ashkore-ubuntu:~$ sudo apt-get install openssh-server
[sudo] password for ashkore:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
openssh-client
Suggested packages:
libpam-ssh keychain rssh molly-guard
The following packages will be upgraded:
openssh-client openssh-server
2 upgraded, 0 newly installed, 0 to remove and 210 not upgraded.
Need to get 904kB of archives.
After unpacking, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ca.archive.ubuntu.com gutsy-updates/main openssh-server 1:4.6p1-5ubuntu0.2 [248kB]
Get:2 http://ca.archive.ubuntu.com gutsy-updates/main openssh-client 1:4.6p1-5ubuntu0.2 [657kB]
Fetched 904kB in 1s (480kB/s)
Preconfiguring packages ...
(Reading database ... dpkg: ../../src/filesdb.c:564: findnamenode: Assertion `(*pointerp)->name[0] == '/'' failed.
E: Sub-process /usr/bin/dpkg exited unexpectedly


Here is also what I get.
IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
KoM: there aren't enough home *nix users who feel the need to SSH into their home computers to be noticeable in subscription churn for most ISPs, much less influence ISP policy.

Does that happen if you try again?

Also, have you been keeping your system up to date otherwise?

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
ricree101
Member
Member # 7749

 - posted      Profile for ricree101   Email ricree101         Edit/Delete Post 
quote:
Originally posted by fugu13:
KoM: there aren't enough home *nix users who feel the need to SSH into their home computers to be noticeable in subscription churn for most ISPs, much less influence ISP policy.

Yeah, although it would likely be different if they tried to block outgoing ssh. At any rate, that was just the first thing that came to mind when Blayne said that he was pretty sure that everything was open at his end, but applications outside of the network didn't see anything.
Posts: 2437 | Registered: Apr 2005  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
or inside, i try to log on using a lan ip and I get the unreachable error.
IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
WHAT! Ido not understand.

Okay so I reran the program as instructed it successfully installedopen ssh and restarted it.

Before that port 22 was closed.

Now it is open now everything works.

Iam confuzzled. How did the open-ssh deamon effect port 22?

IP: Logged | Report this post to a Moderator
ricree101
Member
Member # 7749

 - posted      Profile for ricree101   Email ricree101         Edit/Delete Post 
Oh, I misunderstood what you were saying then, sorry.
Posts: 2437 | Registered: Apr 2005  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
so ya due to bigger problems at the time I didnt mention I had this mildly annoying issue.

When i do 'ls' to view my pwd files and folders I get:

root@ashkore-ubuntu:~# ls
ls: unrecognized prefix: do
ls: unparsable value for LS_COLORS environment variable

but while it still spits out my pwd f&f it gives no colors and has that annoying error each time, rebooting didn't help.

IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
Blayne, there was nothing listening on port 22 until you installed SSH. If there's nothing listening on a port, you can't connect to that port.

The first time you tried installing the server there was some error, which looks to be intermittent based on a search, which is why I advised you to try installing again.

As for the ls, read the message. It told you the problem. It doesn't understand the LS_COLORS environment variable. I bet the variable starts with 'do' right now.

Tell us what you see when you type echo $LS_COLORS . Then see if you can figure out how to fix it by doing a google search.

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Alcon
Member
Member # 6645

 - posted      Profile for Alcon   Email Alcon         Edit/Delete Post 
Blayne, what did you do to that poor machine? Bigger problems? You maybe wanna mention them rather than mentioning each little symptom one at a time?

Also, these errors you're getting tell you something. Work on your googlefu. Often if you enter the errors you get into google someone else has had the problem and posted how to fix it.

And yeah, the port wasn't closed. But you can't ssh onto your machine unless you have an ssh server running. That's a good thing, cause other wise any old hacker could get into your machine through any old port and play merry hell with it. It's the same that if you don't have Apache running, it doesn't matter if you have html files in your /var/www directory. You won't be able to see them if you go to your machine from a web browser.

Posts: 3295 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
the bigger problem was getting port 22 working as I like to do alot of work from school.

I googled up
ls: unknown prefix do
ls: unparsable value for LS_COLORS environment variable

and I do not get anything useful, on one hand it is either a rootkit on one extreme or something else on the other.

IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
You know what an environment variable is, right? Try reading the error. It tells you that it can't parse the LS_COLORS environment variable.

So, the first thing you should do is take a look at that environment variable, which you'd do by typing what I told you to. When you notice 'do' in it, you'll understand that the first part of the error is just the specific problem matching the more general one.

Since you know the LS_COLORS environment variable has a bad value, the next thing to do is figure out what a good value is. Google for LS_COLORS. You can find numerous links in the first page that have various possibilities and suggestions. Then you can try one or several by setting the LS_COLORS environment variable and trying ls again.

However, there's still one part to the 'mystery'. How did the LS_COLORS variable get set to the wrong value in the first place, and how to make sure it gets set to a useful value in the future? I'll give you a hint of sorts about that, and I know you're smart enough to follow up: where are environment variables commonly set for bash?

You are not a simple automaton. Trouble shooting involves noticing error structure that you can understand. I know you've been taught what an environment variable is, and the basics of working with them.

Btw, you weren't 'getting port 22 working', you were getting sshd working. It just happens to be on port 22. That's just a convention.

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
so far I did echo $LS_COLORS and it spat out a whole lot of stuff however there was no "do" in it.

I tried doing 'dircolors' and running what it outputted but that didn't work either.


After some quick googleing I found:

alias ls='ls --color'
LS_COLORS='di=34:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90'
export LS_COLORS

gets me what I want but if I log off and log back on it doesnt save it the settings.

IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
And where, Blayne, are environment variables commonly set for bash?
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
.bash_profile ?
IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
That's one of the most common ones. Perhaps take a look in there to see if LS_COLORS is already being set, and see what happens if you put the commands you ran in at the end.
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
.bash_profile doesn't seem to exist...

i try putting it into .bashrc but that didnt seem to work.

IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
okay I created my own bash profile file added the commands and now it works I can now officialy start work on creating a webpage.
IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
Alright well my Linux server works just fine though there seems to be a billion and a half apps that are missing like gcc.

Okay so what do I need to make a web server/domain thingy?

I think I need to install PHP and Apache but I am hitting a wall installing Apache.

What are all the various packages I need to properly install PHP and Apache?

IP: Logged | Report this post to a Moderator
HollowEarth
Member
Member # 2586

 - posted      Profile for HollowEarth   Email HollowEarth         Edit/Delete Post 
Before we assist you, what have you tried?
Posts: 1621 | Registered: Oct 2001  |  IP: Logged | Report this post to a Moderator
TomDavidson
Member
Member # 124

 - posted      Profile for TomDavidson   Email TomDavidson         Edit/Delete Post 
Blayne, have you considered actually reading the documentation? It exists.
Posts: 37449 | Registered: May 1999  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
How are you trying to install things? Use package management. Stop even trying to use the command line, since that seems to cause you trouble. The GUI in Ubuntu is good. Search for apache and install the apache2 package. You will also want libapache2-mod-php5.
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Tstorm
Member
Member # 1871

 - posted      Profile for Tstorm   Email Tstorm         Edit/Delete Post 
Egads. There's got to be a dozen good tutorials within a few mouse clicks on Google...
Posts: 1813 | Registered: Apr 2001  |  IP: Logged | Report this post to a Moderator
Alcon
Member
Member # 6645

 - posted      Profile for Alcon   Email Alcon         Edit/Delete Post 
And if you're stuck with the command line use aptitude instead of apt-get. It's a command line equivalent to the nice gui package manager. Let's you search packages and such.
Posts: 3295 | Registered: Jun 2004  |  IP: Logged | Report this post to a Moderator
King of Men
Member
Member # 6684

 - posted      Profile for King of Men   Email King of Men         Edit/Delete Post 
Well, I can log in now, but emacs still segfaults. [Smile]
Posts: 10645 | Registered: Jul 2004  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
Well I do ./configure it blew up, I had to apt-get about 80 megs of packages before it would complete but when i try make its explodes.
IP: Logged | Report this post to a Moderator
HollowEarth
Member
Member # 2586

 - posted      Profile for HollowEarth   Email HollowEarth         Edit/Delete Post 
What are you trying to install that isn't in the repositories? And yeah you'll need to install a full build system since it's not part of the base install.
Posts: 1621 | Registered: Oct 2001  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
code:
Fetched 193B in 23s (8B/s)
Reading package lists... Error!
E: Problem parsing dependency Depends
E: Error occurred while processing slapd (NewVersion1)
E: Problem with MergeList /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_gutsy-security_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.

when I try to do apt-get update I get this.
IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
I don't know why you'd be installing slapd at all. That's an ldap server. If you've borked with installing software on your own too much instead of using proper package management, it will probably be easier to recover by reinstalling than by unraveling what you've done.

What happens if you do apt-get install apache2?

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
Reading package lists... Error!
E: Problem parsing dependency Depends
E: Error occurred while processing slapd (NewVersion1)
E: Problem with MergeList /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_gutsy-security_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.


I get this. which was why someone on the ubuntu mirc suggested apt-get update.

IP: Logged | Report this post to a Moderator
  This topic comprises 2 pages: 1  2   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2