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 www.aurora-contracting.com.

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 www.aurora-contracting.com 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.

Forum: 
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! :)

scrungy_doolittle's picture

I finally gave up on it.  Without a gui, it is impossible to figure out. I did find however, that to do what I wanted to do, I had to configure   virtual hosts, and that will allow me to serve multiple sites on the same server. I downloaded a lamp stack from bitnami, I think that runs under windows 7. The problem with the linux universe, is that everyone thinks that the command line is sooooo much better, that linux should NOT look and feel like windows.  Until the collective linux universe gets their head out of a dark warm smelly place, and realizes that there needs to be a version that looks, and works like windows, it will NEVER take over the desktop.  I hate Microsoft, and want very much to get away from them, but very few distros of linux look or even feel like windows.  Julinux is the exception, and in that case, a light weight IDE and a windows theme fixes most of the problems.  The menus have also been re-arranged to better match windows.  It is XP themed.  I'd love to find another turn key distro that had a script that would access a windows installation cd or partition, and copy all the icons and then replace all the standard linux icons with the windows versons.   
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.

scrungy_doolittle's picture

yes I tried it.

The problem is that I don't see a way to have it co-exist with multiple sites. It has an index file, and every other site has an index file, and you can't put them all in the same directory.

I think that the lamp stack should come with a set up for virtual hosts configured for at least 3 web sites to be served from the same server.  One web site connects to web min, and the other two have minimal templates in them.

But the gui is important.  How else are you going to be able to run a wisiwig web editor to build the website?

At a minimum, it needs samba, a light weight gui, a good web editor, like blue griffon, or something similar, a photo processing program, and a word processor.

The goal is a stand alone web system, that you can created and edit a web page on, and publish it on, and serve at least two 3 ip addressed sites.  There *has* to be some way of setting up web sites in different directories, and just putting them in www/var does not work at all.

bitnami wamp stack at least lets me do that.  HOWEVER, I'd much rather have my server running on linux, cause I think it is a bit more robust than windows. :)  It's just that the lamp stack should not be designed to be headless. Yes, it makes it smaller.  But when looking for a turnkey web server, that can be loaded and used to develop and publish a web site or two, there is just nothing out there that is preconfigured for the following scenario.

1. a total noobe to liunux.  A pre installed web server, with sql,php and cgi all installed, that includes some built in tempate sites, can host multiple web sites and has the necessary tools to create the web page with a gui interface.

Sure there are many distros that provide these, but none are PRECONFIGUIRED so a total noobe can simply install it, boot into it, create or copy a web site from somewhere else and be up and running.

I don't want to be editing config files, or if I am, it needs to be an html form that lets you go in and specify the parameters via fields.   like, a box to specify where the web site is located, the ip or name, tick boxes to configure boolean fields in the config file.  Basically a front end gui that lets you configure the server simply, without a large learning curve, and will automatically make the changes to the config file.

Ask me how many web sites I want to configure.  What the name of each web site is.  Whether they should be accessible via ip, or by a dns name, and a few other questions,  click a button and the structure is prebuilt, with dummy templates, and a correct config file.

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 www.newsite1.com
# ServerAlias ww2.newsite1.com
#
# 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: https://www.turnkeylinux.org/docs/admin-server-and-edit-files. 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