negokot's picture

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?

Forum: 
Jeremy Davis's picture

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.

negokot's picture

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 Davis's picture

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...

Jeremy Davis's picture

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?

Jeremy Davis's picture

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

Add new comment