Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Ok I give in
PostPosted: Mon Aug 24, 2009 9:14 pm 
Offline
Senior Newbie

Joined: Mon Aug 24, 2009 8:59 pm
Posts: 14
Website: http://thelongmile.net
Location: Wales, UK
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 :)


Top
   
 Post subject: Re: Ok I give in
PostPosted: Mon Aug 24, 2009 11:36 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
First, a warning: my experience is with Ubuntu Server 8.04, not Debian. While they are similar, there may be differences.
thelongmile wrote:
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:
Code:
    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 wrote:
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 wrote:
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.


Top
   
 Post subject:
PostPosted: Tue Aug 25, 2009 12:09 am 
Offline
Senior Member
User avatar

Joined: Sun Feb 08, 2004 7:18 pm
Posts: 562
Location: Austin
FYI, Debian defaults to /var/www, with nothing in /srv.


Top
   
 Post subject:
PostPosted: Tue Aug 25, 2009 2:50 am 
Offline
Senior Newbie

Joined: Mon Aug 24, 2009 8:59 pm
Posts: 14
Website: http://thelongmile.net
Location: Wales, UK
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
Code:
/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 :)


Top
   
PostPosted: Tue Aug 25, 2009 4:50 am 
Offline
Junior Member
User avatar

Joined: Thu Apr 23, 2009 2:32 am
Posts: 41
Website: http://www.linode.com/
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.


Top
   
 Post subject:
PostPosted: Tue Aug 25, 2009 11:28 am 
Offline
Senior Member

Joined: Sat Mar 28, 2009 4:23 pm
Posts: 415
Website: http://jedsmith.org/
Location: Out of his depth and job-hopping without a clue about network security fundamentals
Xan wrote:
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.

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


Top
   
 Post subject:
PostPosted: Tue Aug 25, 2009 11:58 am 
Offline
Senior Member
User avatar

Joined: Sun Feb 08, 2004 7:18 pm
Posts: 562
Location: Austin
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?


Top
   
 Post subject:
PostPosted: Tue Aug 25, 2009 12:01 pm 
Offline
Senior Member

Joined: Sat Mar 28, 2009 4:23 pm
Posts: 415
Website: http://jedsmith.org/
Location: Out of his depth and job-hopping without a clue about network security fundamentals
Xan wrote:
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.

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


Top
   
 Post subject:
PostPosted: Tue Aug 25, 2009 2:06 pm 
Offline
Senior Newbie

Joined: Mon Aug 24, 2009 8:59 pm
Posts: 14
Website: http://thelongmile.net
Location: Wales, UK
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?


Code:
<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
Code:
 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....
Code:
 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 -
Code:
<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[/code]


Top
   
 Post subject:
PostPosted: Tue Aug 25, 2009 2:52 pm 
Offline
Senior Newbie

Joined: Mon Aug 24, 2009 8:59 pm
Posts: 14
Website: http://thelongmile.net
Location: Wales, UK
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)


Top
   
 Post subject:
PostPosted: Tue Aug 25, 2009 4:17 pm 
Offline
Senior Newbie

Joined: Mon Aug 24, 2009 8:59 pm
Posts: 14
Website: http://thelongmile.net
Location: Wales, UK
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 :)


Top
   
 Post subject:
PostPosted: Wed Aug 26, 2009 10:31 am 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
thelongmile wrote:
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?


Top
   
 Post subject:
PostPosted: Wed Aug 26, 2009 10:39 am 
Offline
Senior Newbie

Joined: Mon Aug 24, 2009 8:59 pm
Posts: 14
Website: http://thelongmile.net
Location: Wales, UK
i guess theres no real way to make it more secure then?


Top
   
 Post subject:
PostPosted: Wed Aug 26, 2009 10:41 am 
Offline
Senior Member

Joined: Wed Feb 13, 2008 2:40 pm
Posts: 126
Yeah, use SFTP or SCP


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group