UBUNTU SERVER8.10/XAMPP FOR LINUX/WEBSITE TUTORIAL FOR NOOBS

Problems with the Linux version of XAMPP, questions, comments, and anything related.

UBUNTU SERVER8.10/XAMPP FOR LINUX/WEBSITE TUTORIAL FOR NOOBS

Postby hotdogs » 28. November 2008 18:20

THIS IS MY SECOND DAY USING LINUX AND I JUST WANTED TO MAKE AN EASY-TO-FOLLOW TUTORIAL FOR NOOBS!! I PROUDLY PRESENT...

HOTDOG'S UBUNTU SERVER 8.10, XAMPP FOR LINUX, AND WEBSITE CONFIGURATION TUTORIAL FOR NOOBS!!
(DERIVED FROM http://ubuntuforums.org/showthread.php?t=223410)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

NOTE: IF YOU HAVE THE LUXURY OF SETTING UP AN OLD OR NEW COMPUTER (AND CAN WORK FROM ANOTHER ONE CONNECTED TO THE INTERNET), I WOULD HIGHLY RECOMMEND A COMPLETE FORMAT USING DBAN WHICH CAN BE FOUND HERE: http://www.dban.org./download. YOU CAN MOUNT AND BURN THE ISO WITH http://www.gburner.com/download.htm. PLEASE BE CAREFUL AS THIS BOOTABLE ISO WILL DESTROY ALL THE DATA ON YOUR COMPUTER!! OTHERWISE, YOU CAN IGNORE THIS MESSAGE.

NOTE: THIS TUTORIAL WORKS ON THE PREMISE OF HAVING A THIRD-PARTY DNS SETUP IF YOU DON'T RUN YOUR OWN DNS SERVER. I HIGHLY RECOMMEND http://www.afraid.org FOR FREE DNS SERVICES!! SIMPLY SIGNUP AND POINT YOUR 'A' RECORDS TO YOUR EXTERNAL I.P. ADDRESS WHICH CAN BE FOUND HERE http://www.whatismyip.com

1. INSTALL UBUNTU SERVER EDITION 8.10 ON CD OR DVD

DOWNLOAD ISO HERE:

http://ubuntu.gds.tuwien.ac.at/cdimage/releases/intrepid/ubuntu-8.10-server-i386.iso

OR FROM OTHER MIRRORS HERE:

http://www.ubuntu.com/getubuntu/download

MOUNT AND BURN ISO WITH GBURNER:

http://www.gburner.com/download.htm

UPON INSTALL, MAKE SURE TO USE A STRONG PASSWORD (UPPER AND LOWER CASE ALPHA-NUMERIC COMBO)!! WRITE IT DOWN!!

HOSTNAME: XXXXXXXXXX
USERNAME: XXXXXXXXXX
PASSWORD: XXXXXXXXXX

NOTE: YOU CAN CHOOSE TO INSTALL THE LAMP SERVER WHEN PROMPTED.

2. INSTALL WINDOWS-LIKE GUI 'GNOME DESKTOP' ON UBUNTU SERVER:

Code: Select all
sudo apt-get install ubuntu-desktop


3. DOWNLOAD XAMPP tar.gz FILE TO DESKTOP http://www.apachefriends.org/download.php?xampp-linux-1.6.8a.tar.gz, OPEN TERMINAL AND TYPE:

Code: Select all
cd ~/Desktop


THEN...

Code: Select all
sudo tar xvfz xampp-linux[HIT THE TAB BUTTON] -C /opt


4. START XAMPP:

TO START XAMPP, OPEN A TERMINAL AND TYPE THIS:

Code: Select all
sudo /opt/lampp/lampp start


5. STOP XAMPP:

TO STOP XAMPP, OPEN A TERMINAL AND TYPE THIS:

Code: Select all
sudo /opt/lampp/lampp stop


6. CHECK ADDITIONAL XAMPP COMMANDS BY PASTING THE FOLLOWING IN A TERMINAL:

Code: Select all
sudo /opt/lampp/lampp


7. GET THE XAMPP GUI-BASED CONTROL PANEL GOING BY PASTING THE FOLLOWING IN A TERMINAL:

Code: Select all
sudo gedit /usr/share/applications/xampp-control-panel.desktop


8. PASTE THE FOLLOWING CODE INTO THE OPEN FILE, SAVE AND EXIT:

Code: Select all
[Desktop Entry]
Encoding=UTF-8
Name=XAMPP Control Panel
Comment=Start and Stop XAMPP
Exec=gksudo "python /opt/lampp/share/xampp-control-panel/xampp-control-panel.py"
Icon=/usr/share/icons/Tango/scalable/devices/network-wired.svg
Terminal=false
Type=Application
Categories=GNOME;Application;Network;
StartupNotify=true


NOTE: "XAMPP Control Panel" WILL NOW SHOW UP IN YOUR APPLICATIONS MENU UNDER 'INTERNET'.

Image

NOTE: IF YOU GET ERRORS WHEN EDITING AND SAVING FILES PLEASE VIEW STEP 15 AND COME BACK TO THIS STEP WHEN FINISHED!!

9. TEST TO SEE IF XAMPP IS RUNNING:

ONCE XAMPP IS UP AND RUNNING, OPEN FIREFOX AND GO TO: http://localhost/

YOU SHOULD SEE THE XAMPP TEST PAGE!!

10. LOCATION OF FILES AND UPLOADING:


XAMPP BY DEFAULT USES /opt/lampp/htdocs AS THE ROOT WEB DIRECTORY. THE EASIEST WAY TO START WORKING ON FILES IS TO LINK A FOLDER IN YOUR HOME DIRECTORY INTO THIS DIRECTORY. MY USERNAME IS steve SO I HAVE /home/steve/public_html LINKED TO /opt/lampp/htdocs/steve. SO IF I NAVIGATE TO http://localhost/steve/ I GET A LISTING OF ALL THE files/folders IN THAT DIRECTORY. (AS LONG AS THERE ISN'T AN index.php/html/etc FILE)

TO SET THIS UP:

A. MAKE public_html DIRECTORY IN HOME DIRECTORY BY OPENING A TERMINAL AND TYPING:

Code: Select all
mkdir ~/public_html


B. LINK TO /opt/lampp/htdocs BY TYPING THE FOLLOWING IN THE TERMINAL:

Code: Select all
sudo ln -s ~/public_html /opt/lampp/htdocs/$USER


NOW ANY FILES AND FOLDERS YOU PLACE IN ~/public_html WILL BE PUBLISHED TO YOUR PERSONAL WEB SERVER!!

BOOKMARK http://localhost/username TO MAKE THIS EASY TO ACCESS.

11. WARNING - SECURITY:

Open holes:

1. The MySQL administrator (root) has no password.
2. The MySQL daemon is accessible via network.
3. ProFTPD uses the password "lampp" for user "nobody".
4. PhpMyAdmin is accessible via network.
5. Examples are accessible via network.
6. MySQL and Apache running under the same user (nobody).

THIS DOESN'T LEAVE YOUR WHOLE SYSTEM WIDE OPEN, BUT SOMEONE COULD HACK YOUR XAMPP INSTALLATION, SO BE WARY!!

TO FIX MOST OF THE SECURITY WEAKNESSES, OPEN A TERMINAL AND TYPE:

Code: Select all
sudo /opt/lampp/lampp security


12. STARTING FROM THE XAMPP SECURITY TERMINAL:

A. PASSWORD PROTECT XAMPP PAGES!

YOUR XAMPP PAGES ARE NOT SECURED BY A PASSWORD!!

B. CREATE PASSWORD / VERIFY PASSWORD

NOTE: THIS USES 'lampp' AS DEFAULT USERNAME!!

MySQL IS ACCESSIBLE VIA THE NETWORK:

C. TURN IT OFF!

THE MySQL/phpMYAdmin USER pma HAS NO PASSWORD SET!!

D. SET PASSWORD!!

MySQL HAS NO ROOT PASSWORD SET!!

WRITE THE PASSWORD DOWN TO MAKE SURE YOU DON'T FORGET IT!!

E. SET PASSWORD!!

NOTE: THE FTP PASSWORD IS STILL SET TO 'lampp'.

F. CHANGE PASSWORD!!

13. NOW REMEMBER, ANY FILES AND FOLDERS YOU PLACE IN ~/public_html WILL BE PUBLISHED TO YOUR PERSONAL WEB SEVER... BUT, I USE THE 'htdocs' FOLDER AND SIMPLY CREATE VARIOUS FOLDERS IN IT FOR MY VARIOUS WEBSITES!! ;)

14. IMPORTANT NOTES:

- LAMPP INSTALL DIRECTORY RESIDES IN Computer/Filesystem/opt/

- HT DOCS FOLDER RESIDES IN Computer/Filesystem/opt/lampp/

- HTTPD.CONF FILE RESIDES IN Computer/Filesystem/opt/lampp/htdocs/etc/

- HOSTS FILE RESIDES IN Computer/Filesystem/etc/

15. MUST BE LOGGED IN AS ROOT TO EDIT/CHANGE CONFIGURATION FILES:

- GO TO System --> Administration --> Login Window --> Security --> Check box "Allow local system administrator login".

- MAY NEED TO RESTART YOUR COMPUTER!!

A. OPEN UP A TERMINAL AND TYPE:

Code: Select all
sudo -s


THEN...

Code: Select all
sudo passwd root


CHANGE/CREATE NEW UNIX PASSWORD!!

B. LOGOUT AS USER 'steve' (OR WHATEVER YOUR NAME IS).

C. LOGIN AS USER 'root' WITH NEW PASSWORD 'XXXXXXXXXX'.

16. NOW ONTO CONFIGURING YOUR FIRST WEBSITE!!

A. OPEN hosts FILE IN Computer/Filesystem/etc/

ADD THE FOLLOWING TO THE TOP UNDER THE OTHER 127.0.0.1 AND 127.0.1.1 LINES:

Code: Select all
127.0.0.1     http://mysite.com
127.0.0.1     http://www.mysite.com


SAVE AND CLOSE!!

B. OPEN Computer/Filesystem/opt/lampp/etc/extra/httpd-vhosts.conf AND ADD:

Code: Select all
<VirtualHost *:80>
      ServerName mysite.com
      ServerAlias www.mysite.com
      DocumentRoot /opt/lampp/htdocs/mysite
</VirtualHost>


SAVE AND CLOSE!!

C. OPEN A TERMINAL AND TYPE:

Code: Select all
ifconfig -a


THIS WILL ALLOW YOU TO DETERMINE YOUR 'eth0' DEFAULT GATEWAY. IN MY CASE, MY DEFAULT GATEWAY IS 192.168.1.102.

CHANGE YOUR ROUTER SETTINGS TO REFLECT YOUR DEFAULT GATEWAY!! (TYPE 192.168.1.1 IN BROWSER, FILL IN PASS "admin", and CHANGE SETTINGS). NOTE: THIS STEP MAY NOT BE NECESSARY IF YOU ONLY HAVE ONE COMPUTER IN WHICH CASE YOUR DEFAULT GATEWAY SHOULD AUTOMATICALLY BE 192.168.1.1.

17. REMEMBER TO PUT YOUR VIRTUAL HOSTS IN Computer/Filesystem/opt/lampp/etc/extra/httpd-vhosts.conf file.


TO MAKE XAMPP ACTUALLY LOOK FOR THE EXTRA APACHE SETTINGS (i.e. virtual hosts), MAKE SURE THAT THE FOLLOWING LINES ARE UNCOMMENTED IN YOUR httpd.conf file:

Code: Select all
# Virtual hosts
Include etc/extra/httpd-vhosts.conf

# Various default settings
Include etc/extra/httpd-default.conf

# XAMPP
Include etc/extra/httpd-xampp.conf


- AFTER THAT, GIVE XAMPP A RESTART AND EVERYTHING SHOULD BE WORKING!!

- TO ADD MORE WEBSITES, SIMPLY REPEAT STEP 16 A AND B!!

- ANY COMMENTS ON HOW TO IMPROVE THIS TUTORIAL ARE WELCOME!!

- CHEERS!!

- HOTDOGS :D
help out the new guy!
hotdogs
 
Posts: 9
Joined: 20. May 2008 15:39

Re: UBUNTU SERVER8.10/XAMPP FOR LINUX/WEBSITE TUTORIAL FOR NOOBS

Postby dmphotography » 06. January 2009 16:40

This sounds really awesome! I looked through it and I'll definitely try this out. I'm a complete newbie when it comes to Linux and trying to figure out all the work arounds in it compared to Windows can be major pain in the butt. I will do some testing and if I get comfortable enough with transferring to Linux, I will probably convert my server over from Windows Server 2003.

By the way, I'm trying to assemble a website with some really good and easy to follow tutorials for people just getting started and wanting to know how to start their own web server. What I could really use is someone like you who has a really good grasp on Linux and using XAMPP with it to help with installing and configuring add-ons. The best way to explain it is just take a look at my website, http://www.myownserver.info and you'll get an idea of what I'm talking about.

If you'd be interested, let me know. It's my way of giving back to everyone who's helped me and try to make it as simple as possible for someone new to it all to install and configure their own web server very easily.

Thanks!
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests