Sharing xampp forlder for Linux and Windows Install???

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

Sharing xampp forlder for Linux and Windows Install???

Postby arbme » 19. February 2010 15:44

Hi,

I have currently installed xammp on my windows partition. Could I share the windows install with the Linux xampp I am about to install to save me having 2 xampp installs as Im am sort on space or will there be conflicts?

Thanks

arbme
arbme
 
Posts: 1
Joined: 19. February 2010 15:37

Re: Sharing xampp forlder for Linux and Windows Install???

Postby Nobbie » 20. February 2010 12:17

No, of course not, as linux and windows have different binary executables.

You may share parts of Xampp, for example the htdocs folder as well as the MysQL data folder, but you cannot share the full Xampp installation.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Sharing xampp forlder for Linux and Windows Install???

Postby MC10 » 20. February 2010 20:46

The versions for Linux and Windows are also built differently, from what I've read.
MC10
 
Posts: 148
Joined: 20. February 2010 20:13

Re: Sharing xampp forlder for Linux and Windows Install???

Postby sundayboy » 22. February 2010 21:49

I'm keen in a solution for this as well.

I can do this in windows following the instructions of changing documentroot in httpd.conf. XAMPP is in C drive while HTDOCS is in D drive.

However, I've yet to be able to to this in Linux. I have no problem placing HTDOCS elsewhere in the linux root directory (tried /home/ and it works), but cannot set it to D drive (d:/lampp/htdocs).

The error I get is :

Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.
sundayboy
 
Posts: 6
Joined: 22. February 2010 13:58

Re: Sharing xampp forlder for Linux and Windows Install???

Postby syntax_error » 22. February 2010 22:40

sundayboy wrote:However, I've yet to be able to to this in Linux. I have no problem placing HTDOCS elsewhere in the Linux root directory (tried /home/ and it works), but cannot set it to D drive (d:/lampp/htdocs).

This way it will definitely not work in Linux - *NIX doesn't use DOS' filesystem hierarchy. There's no D: drive in your Linux.

As far as I understand, the goal here is to share XAMPP's "htdocs" directory between Windows and Linux installation. It's better to keep this directory on Windows partition - it's really easy to access FAT/NTFS partitions from Linux, but not the other way around.

So, you will have to enable access to your "D" drive. It's possible you have the partition already mounted, just check your /mnt/, /media/ or /windows/ (if it exists) folders. Otherwise community around your distribution or folks at e.g. LinuxQuestions may help you with mounting.

Once you can access data on your Windows partition, just change the DocumentRoot (or Alias or whatever) to the XAMPP's directory on Windows as you have already tried with your /home. E.g. in my case it would be something like /windows/xampp/htdocs/ but your configuration will be probably different, depending on where did you mount your partition with htdocs.
syntax_error
 
Posts: 14
Joined: 09. February 2010 19:24

Re: Sharing xampp forlder for Linux and Windows Install???

Postby sundayboy » 23. February 2010 05:53

Thanks for that explanation.

but cannot set it to D drive (d:/lampp/htdocs).


Sorry, I typed that wrong, it should have been (/media/new volume/lampp/htdocs)

It gives me the same error message. I tried to change the permission for htdocs to chmod 777 but no dice.

I know this can be done in Linux and would really want to do this because later I want to finally move my htdocs to a USB drive instead.
sundayboy
 
Posts: 6
Joined: 22. February 2010 13:58

Re: Sharing xampp forlder for Linux and Windows Install???

Postby syntax_error » 23. February 2010 08:08

sundayboy wrote:It gives me the same error message. I tried to change the permission for htdocs to chmod 777 but no dice.

Every parent folder of your htdocs need at least execution permission for "everyone" (unless it's owned by Apache's user/group) otherwise Apache cannot access it. In this case, you will have to deal also with volume permissions - mount options.

Check the following fstab for parameters you are mounting the partition with: umask, uid, gid. Because Apache is running as different user and group (I think "nobody"?), these permissions should be more permissive for "everyone" (Ubuntu's default umask=007 is not sufficient). So try to add/change the umask in fstab to umask=002 (only disallow "write" for "everyone"), then restart or remount with
Code: Select all
mount -o remount "/media/new volume"


(As I think about that, isn't it that Apache just doesn't like the space in folder name? Maybe try to backslash it - new\ volume - or enclose whole path in quotes.)

It's possible that you won't have these problems with USB drive - but I am afraid you will. This is mounted dynamically. I am not sure how to deal with these drives for mount options; maybe you can add entry for them to fstab, maybe you will have to deal with udev. But this goes way off topic of these forums.
syntax_error
 
Posts: 14
Joined: 09. February 2010 19:24

Re: Sharing xampp forlder for Linux and Windows Install???

Postby sundayboy » 27. February 2010 11:37

Thanks for that, its getting a bit complicated now, I don't quite understand fstab except that when linux boots up it checks this file and mounts the drives I use for ubuntu:

http://www.tuxfiles.org/linuxhelp/fstab.html

According to the link above, I edited my fstab to configure my "new volume" partition :

/dev/sda2 /media/new volume ntfs auto defaults 0 0

But this gives me the error :

Line 11 in /etc/fstab is bad

Could you advice on what to do?
sundayboy
 
Posts: 6
Joined: 22. February 2010 13:58

Re: Sharing xampp forlder for Linux and Windows Install???

Postby sundayboy » 27. February 2010 11:55

OK I got it working!!

I decided learning fstab might take 2 weeks so I read up on pysdm (wish they make naming programs easier) :

http://ubuntuforums.org/showthread.php?t=283131

and downloaded that, and then I understood what you were saying.

I used this program to change the umask to 002 and remounted.

I can see my XAMPP HTDOCS webpages on my windows partition which is great because I can share it between ubuntu and windows' XAMPP :-)

Now to get MySQL to do the same thing....
sundayboy
 
Posts: 6
Joined: 22. February 2010 13:58

Re: Sharing xampp forlder for Linux and Windows Install???

Postby sundayboy » 27. February 2010 11:55

BTW, would what I did affect the my windows partition in windows? Will windows change anything if I boot back into it?

Thanks again for your help.
sundayboy
 
Posts: 6
Joined: 22. February 2010 13:58

Re: Sharing xampp forlder for Linux and Windows Install???

Postby sundayboy » 27. February 2010 13:16

OK I'm having trouble with MySQL.

Edited "my.conf" in /etc/mysql and changed :

datadir = /media/sda4/xampp/mysql/data

but after restarting xampp and mysql its still reading from "/opt/lampp/var/mysql" directory :

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/serve ... ables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#

#
# * IMPORTANT
# If you make changes to these settings and your system uses apparmor, you may
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#
# datadir = /var/lib/mysql

user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /media/sda4/xampp/mysql/data
tmpdir = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/


Funny thing is there's a lot of references to "/var/run/mysqld/" but I can find that anywhere in my filesystem.

I also can't find /etc/apparmor.d/usr.sbin.mysqld, though I have /etc/apparmor.d/ sub directory.
sundayboy
 
Posts: 6
Joined: 22. February 2010 13:58

Re: Sharing xampp forlder for Linux and Windows Install???

Postby syntax_error » 01. March 2010 01:31

sundayboy wrote:BTW, would what I did affect the my windows partition in windows? Will windows change anything if I boot back into it?

If you can read/write to your partition, you can change anything on it. Windows shouldn't change anything, unless you have some program which manipulates with files on your partition.

sundayboy wrote:OK I'm having trouble with MySQL.
Edited "my.conf" in /etc/mysql and changed [...]
but after restarting xampp and mysql its still reading from "/opt/lampp/var/mysql" directory

Of course it does, you've edited wrong configuration file. That's also why there are references to /var/run/mysqld/.
I think there are some leftovers on your system if you have installed MySQL previously, for example through the package manager. Remember, you should (and probably must) run only one MySQL and Apache daemon, so if you have any of these installed aside of XAMPP, you need to get rid of them (disable or uninstall).

The file you're looking for is /opt/lampp/etc/my.cnf. XAMPP is fully self-contained, everything stays in /opt/lampp/ unless you decide otherwise.

Anyway, sharing MySQL data sounds quite dangerous to me, in theory it should work, but make sure you are always running the same versions of MySQL (XAMPP respectively) both on Windows and Linux. Also, make backups if you care about data in the database.
syntax_error
 
Posts: 14
Joined: 09. February 2010 19:24


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 26 guests