This is topic A Question About Webhosting with Linux in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=052624

Posted by Blayne Bradley (Member # 8565) on :
 
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?
 
Posted by Alcon (Member # 6645) on :
 
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.
 
Posted by King of Men (Member # 6684) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by Alcon (Member # 6645) on :
 
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).
 
Posted by Blayne Bradley (Member # 8565) on :
 
yup dlink says 22 is open but doing 'canyouseeme.org' it doesnt see it opened.
 
Posted by Alcon (Member # 6645) on :
 
Do you have a software firewall on your server machine? You'll have to open a hole in that as well.
 
Posted by Blayne Bradley (Member # 8565) on :
 
no software firewall i know of.
 
Posted by Alcon (Member # 6645) on :
 
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?
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by Alcon (Member # 6645) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
sudo root get-apt install sshd?
 
Posted by fugu13 (Member # 2859) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by ricree101 (Member # 7749) on :
 
Is the ISP blocking 22 for some reason?
 
Posted by Blayne Bradley (Member # 8565) on :
 
I can't tell, by ISP you mean the company that sells us the internet? I'll call them up.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by King of Men (Member # 6684) on :
 
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.
 
Posted by Alcon (Member # 6645) on :
 
Have you checked ps aux | grep ssh since you installed the ssh package? Have you restarted the system since you install the ssh package?
 
Posted by Blayne Bradley (Member # 8565) on :
 
ive restarted, ill redo the cmd after calling dlink.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by fugu13 (Member # 2859) on :
 
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?
 
Posted by ricree101 (Member # 7749) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
or inside, i try to log on using a lan ip and I get the unreachable error.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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?
 
Posted by ricree101 (Member # 7749) on :
 
Oh, I misunderstood what you were saying then, sorry.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by fugu13 (Member # 2859) on :
 
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.
 
Posted by Alcon (Member # 6645) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by fugu13 (Member # 2859) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by fugu13 (Member # 2859) on :
 
And where, Blayne, are environment variables commonly set for bash?
 
Posted by Blayne Bradley (Member # 8565) on :
 
.bash_profile ?
 
Posted by fugu13 (Member # 2859) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
.bash_profile doesn't seem to exist...

i try putting it into .bashrc but that didnt seem to work.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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?
 
Posted by HollowEarth (Member # 2586) on :
 
Before we assist you, what have you tried?
 
Posted by TomDavidson (Member # 124) on :
 
Blayne, have you considered actually reading the documentation? It exists.
 
Posted by fugu13 (Member # 2859) on :
 
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.
 
Posted by Tstorm (Member # 1871) on :
 
Egads. There's got to be a dozen good tutorials within a few mouse clicks on Google...
 
Posted by Alcon (Member # 6645) on :
 
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.
 
Posted by King of Men (Member # 6684) on :
 
Well, I can log in now, but emacs still segfaults. [Smile]
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by HollowEarth (Member # 2586) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by fugu13 (Member # 2859) on :
 
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?
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by fugu13 (Member # 2859) on :
 
First, try the following:

apt-get -f remove slapd

Then see if you can do an apt-get clean and an apt-get update.

However, looking around, it looks like your status info may have been corrupted. Try replacing /var/lib/dpkg/status with /var/lib/dpkg/status-old

Then try apt-get clean, followed by apt-get update.
 
Posted by Alcon (Member # 6645) on :
 
At this point I think I'd recommend a reinstall. Seriously, start fresh. You've clearly borked something by fiddling too much. And you're too new to figure it out on your own, and we won't be able to help you that much. Start with a clean Ubuntu Server install (or better yet: Debian). Then use aptitude:
code:
:~$ sudo aptitude

to install what you need rather than apt-get. Aptitude is better because you can search packages and it's much better at handling dependencies and conflicts.
 
Posted by Blayne Bradley (Member # 8565) on :
 
I actually use the Ubuntu desktop for desktop things, I use it as a server whenever I am not home. eg: browsing the net, watching videos, music etc before bed as my ubuntu box /w monitor is next to my bed.
 
Posted by Blayne Bradley (Member # 8565) on :
 
still getting:

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.


and when i try to remove slapd

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.
 
Posted by fugu13 (Member # 2859) on :
 
And that's after replacing /var/lib/dpkg/status with /var/lib/dpkg/status-old?
 
Posted by Blayne Bradley (Member # 8565) on :
 
yup.
 
Posted by fugu13 (Member # 2859) on :
 
Yep, time to reinstall your system. From now on, use proper package management (and since you're using it as a desktop, use the GUI package manager). Don't install things from source or from downloaded .debs. You shouldn't need any of that for the sorts of things you do.
 


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