TurnKey Linux Virtual Appliance Library

Website setup

Hi I've been looking for information on the LAMPStack regarding setting up an actual site with it but I can only seem to find the initial installation but nothing beyond.

I apologize if this has been asked before, I tried searching the forums and documentation thoroughly before posting, but I've setup my LAMPStack, setup the network bridge, and I can log into the webmin through my local network (192.168.1.116:12321). I have also created a user account in the www-data group and assigned it's home directory to /var/www and I keep seeing online people saying "just upload to /var/www" but it appears that's where the webmin is located.

Am I doing something wrong or should I create a subfolder? 192.168.1.116/website will display the index.html I created but do I really have to work within a subfolder? If I overwrite the index.php in /var/www will I lose webmin access?

Jeremy's picture

No, Webmin doesn't even run under Apache

Webmin incorporates it's own mini web server, so you can even stop Apache and Webmin will continue to function. If you overwrite /var/www/index.php then you will lose the TKL landing page (ie what you see when you currently browse to http://<ip-address-or-fqdn>/) but everything else will still work. To clarify; /var/www  is the doc root ie /var/www/index.php displays as http://<ip-address-or-fqdn>/index.php.

Hey Jeremy,Thanks for the

Hey Jeremy,

Thanks for the response, I was talking with a coworker today who said it doesn't matter so long as the .htaccess file is pointing to the correct directory (he listed the example that his website lives in /home)

Is this accurate? I think I understand what you're saying, /var/www only holds the initial 3 option page, but if I were to go to http://<ip-address>:12321 I would still be able to log in to the webmin correct?

I'm excited to get this up and running, and grateful for the support, it's just coming out of the blocks I trip myself up overthinking things

Jeremy's picture

By default TKL LAMP doesn't have .htaccess

But there are many different ways to configure a web server...

.htaccess files can be very handy, especially on shared hosting servers and/or if you want different things going on in different folders (eg public and private areas of your website). But when you're getting started I think they add unneeded complexity, especially when you are running your own LAMP server (al la TKL).

The way the TKL LAMP appliance is configured by default should be a great starting point for having a little play and getting the hang of things. Just drop your html and/or php (etc) files into /var/www and you'll be good to go. If you want to keep the default TKL page you could always rename it, eg:

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

Keep in mind though, by default any files that you drop in there (via SFTP etc) will have the default owership and permissions of the user doing it. Some scripts may need to be owned by the webserver account to function properly.

chown www-data:www-data /var/www/file

And yes you can go directly to Webmin via port 12321 (as you suggest in your post above). The other stuff is there too (eg phpMyAdmin via port 12322, etc).

Also I personally prefer to admin Apache manually rather than Webmin (personally I don't like the way it mangles the config, also I have had some bizarre unexpected things happen...). Learning how to manually configure it is not that hard once you get your head around it. The config for the default site can be found in /etc/apache2/sites-available/default, but personally I'd copy it and play around with the new one. Worst case you can go back to default...

If you want to do that, copy the default site:

cp /etc/apache2/sites-available/default /etc/apache2/sites-available/new-site

then disable the default site, enable the new and reload Apavhe config:

a2dissite default
a2ensite new-site
service apache2 reload

Also an FYI if you plan to learn to config Apache manually, be a little cautious following examples/tutorials found via google. The installation of Apache2 in TKL/Ubuntu/Debian is not the default provided by Apache (and is therefore different to stuff related to Apache on Red Hat/Fedora/CentOS/etc). Some stuff is relevant, but generally I suggest that you stick with Ubuntu tutorials (TKL v11.x is based on Ubuntu 10.04) where possible...

Having similar problems

Tried this tutorial

http://www.packtpub.com/article/develop-php-web-applications-netbeans-vi...

But unfortunately I always get a 404 Not Found error

Hoping someone can help

Jeremy's picture

That's an older version of TKL

Although the theory should be the same. I don't know about the NetBeans part but up to that point should be near enough to get you going...

Assuming that you are on a home style network (where you have a modem/router providing DHCP) and you set the VirtualBox networking to 'Bridged', then the IP address that shows up on the confconsole (as shown in that tutorial) should just work...

Can you ping the address from your host machine?

Works fine if I set the

Works fine if I set the networking to hostonly but not bridged.

Seem to have got this up and running now...

Do you have any documentation on this as I'm now trying to connect remotely via a java app and it fails ... And I think its coming down to a bind address issue with the remote host connecting to the mysql server????

But apart from that all working really well.

It's OK .... fixed. Had to

It's OK .... fixed. Had to edit the /etc/mysql/my.conf file and change the default bind-address from 127 (localhost) to the ipaddress of the server

Jeremy's picture

Glad you got it sorted

But FYI setting up MySQL to allow remote connections is documented in the TKL Docs somewhere (although sounds irrelevant now...)

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)