Ok I give in

I've been trying to follow the debian lenny guide on libray.linode.com but frankly it's confused the hell out of me.

At the moment I have two websites that are live on another hosting provider, where it was all rosy and managed for me.

I've got a little experience with linux but clearly not enough here.

I followed the guide, at least thought I did, then if i navigated to the servers IP address great, i got the apache IT WORKS! page…

So, now comes the confusing bit. Apt-get install phpmyadmin

that happens, no errors… beyond that I've no idea where it is and navigating to the server IP/phpmyadmin no results, page 404 despite restarting the server afterwards to ensure it's running (so, thats confusion number one)

Then i wondered, how i would upload files to the two virtual hosts I had specified that were in /srv/www/websitename1 and websitename2

so, i installed ftp, apt-get install asftpd

thats all i did, so i try and login through ftp and can only do so anonymously, when I do, I get an empty folder, no tree and I cannot figure out how to get it to say ftp into website1 or website2 (confusion number 2)

I then figured I'd have a look at where the website files were, and found that the apache "it works" page is not in srv, but rather /var/www . So now I wonder.. how does it point toward the two virtual host folders i've created, and how can I test and implement the two websites I've already got, before adding the domains in and pointing them to the site. Which then begs the question how do I ftp into the individual sites….

I need… help… almost an idiots guide start to finish, the guide got me further than I thought, I mean, I actually got as far as getting an IT WORKS page, but well.. thats all i got.. and I have never done this before on a linux box… at least, not like this…

Any suggestions are dearly welcomed… on a postcard if one's going spare :)

Thanks :)

13 Replies

First, a warning: my experience is with Ubuntu Server 8.04, not Debian. While they are similar, there may be differences.
@thelongmile:

So, now comes the confusing bit. Apt-get install phpmyadmin

that happens, no errors… beyond that I've no idea where it is and navigating to the server IP/phpmyadmin no results, page 404 despite restarting the server afterwards to ensure it's running (so, thats confusion number one)
On Ubuntu, the package installs into /usr/share/phpmyadmin/. You somehow need to serve these files. One way would be to create a link from within the web root to /usr/share/phpmyadmin/. I instead did it by putting the following into a VirtualHost directive in the site config:

    Alias /pma/ "/usr/share/phpmyadmin/"
    <directory "="" usr="" share="" phpmyadmin="">Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order allow,deny
# Only allow access to phpMyAdmin from localhost
        Allow from 127.0.0.1</directory> 

For security, the "Allow from" only permits connections from localhost. When I need to connect to phpMyAdmin, I create an ssh tunnel via ssh -L 8080:localhost:80 user@mylinode.example.com. Then I can type http://localhost:8080/pma/ into the address bar of my browser and connect to phpMyAdmin over a secure, encrypted connection.

You could replace this with "Allow from all" but then the whole world gets an opportunity to try to hack your MySQL installation. And believe me, they will try.
@thelongmile:

Then i wondered, how i would upload files to the two virtual hosts I had specified that were in /srv/www/websitename1 and websitename2 so, i installed ftp, apt-get install asftpd
You're best off sticking with ssh/scp instead of dealing with FTP. There are plenty of friendly graphical SCP clients available for all the popular operating systems.
@thelongmile:

I then figured I'd have a look at where the website files were, and found that the apache "it works" page is not in srv, but rather /var/www . So now I wonder.. how does it point toward the two virtual host folders i've created, and how can I test and implement the two websites I've already got, before adding the domains in and pointing them to the site.
Like I said before, I'm not very familiar with "the Debian way" and its /srv/ filesystem layout, but you probably want to at least get familiar with Apache name-based virtual hosting before monkeying with things. On the server I work with, the site subdirectories are /var/www/example.org/, /var/www/yoyodyne.com/, etc.

FYI, Debian defaults to /var/www, with nothing in /srv.

ok thank you thats starting to make more sense.

by the way XAN, ok so it defaults to /var/www with nothing in srv, however the guide on library.linode said to create a folder structure as follows

/srv/www/website 1/public_html
/srv/www/website 1/logs
/srv/www/website 2/public_html
/srv/www/website 2/logs

and then tells me to run a2ensite to enable them. Are you saying I should have created the directories in /var/www/ and the guide is in fact incorrect? or does it link to it in some way? from the other guide and what you've said it would appear that the guide is indeed wrong, but I just want to be sure before I restructure my install…

Vance - Normally I would completely agree with scp but I have found that I need access to my FTP directory from other computers when all I have is DOS, so is there any quick and dirty way of enabling it?

If the worst comes to the worst I'm sure once I get over this I can find an open source cpanel with one built in, but, just in case…. actually are there any open source c panels worth looking at ?

Thanks so much for your help already :)

It's not "incorrect" to store your websites in /srv. In fact, it doesn't matter where you store them in the filesystem; that's why you specify their location in the config files for each site. You could store them under "/mywebs" if you wanted, or anywhere else for that matter. The guide is correct.

If you're trying to browse to name-based hosts by putting your Linode's IP address in the URL bar of your browser, you won't get the results you're expecting. You can serve hundreds of websites from a single IP; that's what name-based hosting is for. You're getting the default "It works" page because that's the default site configured for Apache.

You need to use the name specified in the "ServerName" directive for each site hosted on your Linode to reach it in a browser. This means you'll either need to update the DNS for your domains to point to your Linode's IP address, or you can manually point your domains to it on your local workstation by adding entries to your local hosts file.

We generally advise against using control panels, but if you're interested in trying one, http://ispconfig.org is a popular choice among some customers.

@Xan:

FYI, Debian defaults to /var/www, with nothing in /srv.
There's a slight difference between Debian policy and how administrators tailor their box. I've never used the Debian Apache packages because, frankly, their configuration system sucks.

I also place everything that my boxen host under "/srv"; i.e., Web in /srv/www, BitTorrent in /srv/torrent, my zone file is /srv/jedsmith.org, etc. It's up to you, not the Policy Manual.

Just to clarify a few things here. thelongmile, I wasn't trying to snark at you, although I see how it could look that way. To be honest I barely skimmed your post, then noticed that Vance said he was unfamiliar with Debian's /srv. I was just pointing out that that's not the Debian way, at least not by default.

Phil and Jed are absolutely right that there are plenty of "right" ways to set up this kind of thing.

Jed, I'm just curious, what is it you don't like about the Debian Apache packages?

@Xan:

Jed, I'm just curious, what is it you don't like about the Debian Apache packages?
The structure it creates in /etc bothers me, that's all. I understand its merit for large name-based sites, but for one site it's a touch of overkill. I prefer to vi things myself, as well.

Again, can't please anyone.

Thanks all for your help so far, it's answering alot of questions

btw, Xan, I didn't think you were, so sorry if my response seemed that way… dang textedit stuff lol

Ok so I'm afraid I must admit to committing a cardinal sin here, I'm setting this up from a mac, not so bad but hosts could be an issue

So far it seems like general instructions are to follow the original guide it seems, but at least I now understand what it was actually doing and it makes more sense.

Next part i have to ask about is phpmyadmin, you're correct, if you do apt-get install phpmyadmin it does indeed create /usr/share/phpmyadmin

now when you say virtualhost the phpmyadmin, i create a file like I would for a website like this?

 <virtualhost *:80="">ServerAdmin squire@bucknell.net
     ServerName bucknell.net
     ServerAlias www.bucknell.net
     DocumentRoot /srv/www/bucknell.net/public_html/
     ErrorLog /srv/www/bucknell.net/logs/error.log
     CustomLog /srv/www/bucknell.net/logs/access.log combined</virtualhost> 

and instead put

 Alias /pma/ "/usr/share/phpmyadmin/" 
    <directory "="" usr="" share="" phpmyadmin="">Options Indexes MultiViews FollowSymLinks 
        AllowOverride None 
        Order allow,deny 
# Only allow access to phpMyAdmin from localhost 
        Allow from 127.0.0.1</directory> 

Now, I need to be able to get to that from anywhere on the web (i hear what your saying about tunnelling but there are times i have to do it from a works machine)

So I assume that I make it look like….

 Alias /pma/ "/usr/share/phpmyadmin/" 
    <directory "="" usr="" share="" phpmyadmin="">Options Indexes MultiViews FollowSymLinks 
        AllowOverride None 
        Order allow,deny</directory> 

which means I access it from http://serverip/pma ?

or do I need to do -

 <virtualhost *:3389="">Alias /pma/ "/usr/share/phpmyadmin/" 
    <directory "="" usr="" share="" phpmyadmin="">Options Indexes MultiViews FollowSymLinks 
        AllowOverride None 
        Order allow,deny</directory></virtualhost> 

and that would be http://serverip:3389 ?

Ok, next question is about the setting of hosts files. Now, I can do basic hosts editing (never tried on a mac, but can boot into windows if I have to, but… what entry do I put in there?! that part does confuse me, also, any ideas on the FTP? or am I completely going about this the wrong way?

Thanks again all

ok I figured out the hosts file thing so yes, yay I am now able to see the manually written index files in both directories by changing hosts, yay we have a sorta working website lol…

Now phpmyadmin

then ftp

after that tea and biscuits whilst i load and test the site into the server

then manual stats like analog, then after that… i need to work out how to transfer my domain names… (that bit comes later :P)

oh by the way thansk for the cpanel hints, i've been told to look at something like webmin, thoughts?

EDITED:

Ok so thanks to the great people over at the IRC channel (most notably Solver but not forgetting the rest) I have configured phpmyadmin to work by typing in http://namebasedhost:2096

All i need to set up now is a proper FTP solution where i can install it on say thelongmile.net and set up multiple users etc (if anyone has any ideas that would be great) and then I think I'm good to go, mail etc can be set up later (using google I think) but thank you all for your help so far :)

@thelongmile:

All i need to set up now is a proper FTP solution

Just to reiterate what others have said, have you considered sticking with ssh/scp instead of the insecure FTP?

i guess theres no real way to make it more secure then?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct