Scrungy_doolittle's picture

Is there an appropriate forum for a noobie question?

I'm wanting to run a LAMP based server.  I downloaded the LAMP server vm from here, and have it running

in a vmworkstation player on a windows 7 pro 64 bit machine.

Unfortunately, I'm not a linux guru, and Really need this vm to have some kind of gui, and the ability to copy files to it from the windows 7 machine.

The second question involves setting up a web site.  When I navigate to the machine, it comes up with the

normal admin choices, based on the index.php file provided.  I want set up a site

I have the dns pointed to my static cloud facing ip, but don't quite understand how to set up the system so a normal person connecting to will see the target site, but not the web-admin site.

I went to var/www and created a directory aurora-contracting under the www directory.   Now I am trying to copy a site from the drive of my windows 7 pro and do not know how to do it, nor where to put the files if I could

copy them.  And especiallys since the root of the site in both cases is index.

Any pointers to help woudl be appreciated.

ALL of these vm's should at least have a minimal gui, as light weight as possible.  Not all the customers for this site are command line profecient.

Jeremy Davis's picture

It has a web UI known as "Webmin". The landing page (i.e. access your LAMP server via your web browser) should have a link directly to it! It should be available via https on port 12321 (i.e. https://YOUR_SERVER_IP:12321).

Webmin has a file manager which you can use if you like, however another option is to use an SFTP/SCP client such as Filezilla or WinSCP. Actually there are a whole myriad of ways that you can connect to your TurnKey server. Have a look at this doc page.

Re your second question, it really depends on exactly what you want to achieve as your end result. The simplest way is to just rename the default index.php in /var/www:

mv /var/www/index.php /var/www/tkl-index.php

Then upload your site to /var/www/

Whilst I understand that not everyone is completely comfortable on the commandline; as an ex-Windows "power-user" and SysAdmin (who worked mainly in the GUI space) I can tell you now, that once you get over the unfamiliarity, armed with a bit of Google-fu it's SOOO much easier and more powerful to work within the commandline! It's also much easier to take notes of exactly what you are doing and you can easily repeat the exact same steps with the exact same results. Anyway, enough evangelism from me! :)

Jeremy Davis's picture

We provide Webmin for those not comfortable with the commandline. Did you try it out? TBH I'm not a big fan, but you already know I prefer the commandline, so that's a biased opinion!

Also sorry I didn't realise that you wanted to host multiple sites. I was under the impression that you just wanted to host one, in which case creating a new virtualhost is overkill (the default one is fine for a single site). Assuming that it's html or a simple PHP app, all you need to do is upload your site to /var/www (and overwrite, delete or rename the original index.php, i.e. the "control panel") and it should just work, nothing else to do...

Anyway, I'm glad to hear that the Bitnami installer works for you. I haven't had any experience with them, but I'm pretty sure that they provide a WAMP (Windows Apache MySQL PHP) server stack Windows installer. Back when I first started playing with open source I fiddled with WAMP (not from Bitnami, but similar thing). I'm not sure what Bitnami provide, but the one I used didn't have any management GUI so it still relied on editing text files and using the commandline (which I wasn't familiar with or comfortable with).

Comapred to a GUI, personally I find the Linux commandline quicker, easier, more reliable and less confusing. It's funny though, 8-10 years ago I would have 100% agreed with you! I was a Windows GUI user (and lover). But that's ok, we all have different opinions and sometimes they change over time... Aren't we lucky that there are so many options available and people can use what works best for them!? :)

I'm sorry to hear that TurnKey didn't work out for you, but take care and good luck with it all.

Jeremy Davis's picture

Firstly, apologies on this really long post. I hope that it makes sense. It took me way longer to write than I'd normally like to spend on the forums, but I wanted to properly address your thoughts and suggestions.

If I understand correctly, essentially you are suggesting a "noob-dev" server?! I.e. a server with a full desktop GUI and some UI tools for developing a website. That would certainly make sense if you were self hosting locally, or only intended to run as a local VM for development work, which you can then sync with a "proper" production server (e.g. TurnKey on Amazon). FWIW most web developers have a workflow something like that anyway, a local dev server and a remote production server.

In essence I think that that's a pretty cool idea. Although unfortunately that's outside the brief of TurnKey, at least currently... We aim to provide servers which as as light weight as possible, whilst still being as easy to use as we can make them. An appliance as per your suggestion would have to be an additional LAMP appliance, not a replacement for our existing one. If we included a full GUI, pre-installed WYSIWIG editors and Samba integration OOTB in our LAMP appliance, I guarantee that there would be a revolt from our thousands of existing LAMP users!

I think a fundamental part of the problem though still remains. I am not aware of any existing GUI tools for Apache configuration. So either you'd still need to edit text files, or someone would need to develop GUI Apache admin software. I suspect why nothing exists (beyond Webmin and similar WebUIs) is that those that would like it don't have the skills to develop it. And those that have the skills to develop, don't have the need (they just edit the text files).

We are a small team and are already run off our feet. To develop and maintain a GUI app at this point is much more than we can afford. And seeing as we give our servers away and make no money out of them (other than via Amazon hosting and backups) we can't really justify spending a ton of resources on something that would most likely provide limited returns (who wants to pay Amazon 3x what a normal LAMP server costs to run, just to include a desktop that would rarely be used except during development). Don't get me wrong, we're not all about making money, but we still need to pay the bills! Perhaps one day if/when we grow big enough to justify the development and maintenance costs...?! Obviously if someone else discovered or developed something appropriate, we could look to leverage that at minimal expense.

Working with what we have

So in the meantime if you wanted to use TurnKey, you'd need to adjust your workflow.

Using the (single) default virtualhost

With regard to using your server to host just one site, if you simply rename the default index.php to tkl-index.php (or whatever you like - so long as it doesn't clash with any other filenames) as I noted in my first post, then for a simple html site you can still access it (via http://YOUR_SITE/tkl-index.php). Alternatively, you could create a new directory and move it there (no need for an additional virtual host). E.g.:

# make new 'turnkey' subdirectory
mkdir /var/www/turnkey 
# move default index file into new dir
mv /var/www/index.php /var/www/turnkey/index.php 
Then the current landing page will be available from http://YOUR_SITE/turnkey Admittedly some more complex PHP apps may block access to it, which would require a separate virtual host to work around. Another option is to just delete it all together! You don't really need it, it's essentially just an example page with some handy links. Webshell and Webmin are hosted on separate ports so that shouldn't be an issue.

Creating a new virtualhost

Obviously that still doesn't solve the issue of creating a new virtual host (if you did want to host multiple sites). But additional virtual hosts served over default ports (i.e. http = port 80; https = port 443) requires DNS config to work properly, so unless you have configured that, additional pre-configured virtual hosts have no real value (unless you serve them on alternate ports; as we do with Webmin, Webshell and Adminer).

Webmin does provide the html form facility for editing Apache config and virtual hosts as per your mention for configuring additional Apache virtual hosts. TBH though I find it a bit non-intuitive and clunky. Personally I find just editing the config files is much quicker and easier. E.g.:

# create new docroot directories for your new sites /var/www/new-site1 & /var/www/new-site2
mkdir /var/www/{new-site1,new-site2}
# copy default site to create the basis of your new sites
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/new-site1.conf
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/new-site2.conf
# then adjust the default docroot for your new sites
# I.e. edit /etc/apache2/sites-available/new-site1.conf
# change every instance of /var/www/ to /var/www/new-site1/
# within each VirtualHost -add the 'ServerName' directive
# plus if desired also ServerAlias e.g.
# ServerName
# ServerAlias
# Repeat for new-site2.conf
# enable your new sites and disable the default site
a2ensite newsite1
a2ensite newsite2
a2dissite 000-default
# and restart Apache to apply new settings
service apache2 restart

So long as you have DNS set up correctly, you should now be serving 2 different sites from your one webserver...

Using a GUI WYSIWYG html editor and other GUI tools with TurnKey

Regarding your note on the GUI, it's been a long time since I used a WYSIWYG html editor, but when I last did, I used it locally (on a PC with a GUI) then uploaded the resulting files to the webserver (using a tool such as Filezilla). I recall some editors supported SFTP file transfers directly within the UI (Although it doesn't look like Blue Griffon is one of them). So you can sync your local files straight to the server (no need for an additional step with Filezilla). FWIW TurnKey supports SFTP and SCP OOTB.

Considering that a desktop UI takes more resources (RAM, CPU and HDD storage) than the rest of the server combined (probably 2x-3x more), it seems sub-optimal to include all that extra weight for something that you only ever do occasionally (during development), and can relatively easily be done a different PC.

With regards to your point about pre-installing Samba. Personally I would argue that installing a tool such as WinSSHFS on your Windows system would be a much better option. It keeps the TurnKey images lean and reduces the additional config required on any/all servers. Then you can access the filesystem of any Linux server which has SSH (I've never come across one that doesn't) via Windows Explorer!

As I noted in my first post, there are a ton of different ways to connect to your server and administer it remotely. Here's the link again: Filezilla is a good SFTP file transfer option, but there are others e.g. WinSCP.

Also, the default docroot for your website is /var/www, but as noted above (re adding a new virtual host) you can change that as per your requirements.

Add new comment