Install XAMPP as non-admin - php

I need to install xampp as a normal user and run PHP server with a non-default port.
I have changed the 'Listen 80' in ~/lampp/etc/httpd.conf to another port.
But when i start it using ~/lampp/lampp start, it complains
You need to start XAMPP as root!
Is there any way to run this without root login ?

You need to install xampp as root, but you can run as normal user.
Here is the step by step guides for the same.
http://forums.bizhat.com/linux-freebsd-opensource/41058-how-install-xampp-ubuntu-linux-running-normal-user.html

Related

Laravel valet always asks password

After reinstalling macOS, I started setup my dev environment based on Laracasts "Setup a mac dev machine from scratch". At the previous time when I installed php/valet/composer etc, everything was fine, but now the terminal (in every new session) always asks password when I type valet.
I added the composer path to .zshrc
export PATH=$HOME/bin:/usr/local/bin:$HOME/.composer/vendor/bin:$PATH
In order to get this going you can run the following command:
$ valet trust
This will let you enter the password once, and remember it.
Using the trust command, you indicate that the current machine can be trusted for development, and Valet will stop asking for the password.
Your macOS native apache might be running, try stopping it
sudo apachectl stop
running sudo valet start fixed it for me.

Httpd, myslqd and SELinux

Im running put of patient with SELinux and that stuff...
I have httpd and myslqd running on the same machine with CentOs 6, and both services have their configuration files in a nfs directory exported from another machine.
Everything works fine with Selinux disabled... but when I set it to enforcing, PHP scripts can not communicate with mysql service. Httpd service works fine and mysqld too, if I run "mysql -u root" I can make queries to the database perfectly, but php scripts can not.
I think I'm missing some sebool that allows php to use mysql or something like that, but i can not find the key... some help?
You can set the following flag to allow Apache to connect to a database.
setsebool -P httpd_can_network_connect_db on
The -P option makes the change persist across reboots. You may need sudo to execute this command.

Installing multiple Laravel homestead machines

I was wondering how I would be able to run multiple versions of homestead without having VirtualBox crash.
I am currently running a default installation of the laravel homestead, but I need to install another custom one, which is customised to work with several proxies.
Just to be clear: I know how to run multiple sites. That is not the issue. I just want to run a second, custom version of the Laravel Homestead Vagrant box, while still having the possibility to run my normal one.
Details: I'm running Homestead v2.1.7 on Mac
Thanks in advance!
I know it's an old question, but the problem is still accurate.
There are some circumstances when you have to run two instances of homestead at the same time. For example when you have app that is works with apache, and one that is freaking out when you enable apache on a server. When you enable it on one website in Vagrant.yaml it will redirect every page that is not using apache to the site that is using it, see example:
- map: presta.shop
to: /home/vagrant/htdocs/presta-shop
type: apache
- map: my.app
to: /home/vagrant/htdocs/my-app
In this situation when you will call my.app homestead will redirect you to presta.shop - because this site is using apache (PrestaShop needs to run under apache). See this link: Github NGINX and Apache conflict #555
My my.app will crash with apache enabled, or I just don't want to enable it on this app, or I just need one extra server just for testing or something. You have to follow those steps from install homestead. After the installation of first server you need to:
run VirtualBox (or other machine you are using)
find and rename added homestead box (homestead), to what ever you wish ie: apache_homestead
go to homestead dir (cloned from git)
find file: Homestead.yaml
in Homestead.yaml add new line after provider with name (this is the name of your
renamed box apache_homestead in this case), and ip for let say: 192.168.10.11
in this file you can configure many settings, including name:
ip: "192.168.10.11"
memory: 3072
cpus: 1
provider: virtualbox
name: apache_homestead
After that You may change name of a dir where homestead clone is (default name is homestead). If you rename it to homestead_apache and run vagrant up from this directory you will have completely independent server.
To run "normal" server just follow the instructions from install homestead again and run as many servers as You wish :) Run any just go to it homestead directory and run vagrant up. Remember the limitation of your host machine!
IMPORTANT NOTE!
You can have all files for all servers in one dir, but every server has it's own database!!. So before you will move application to another server export and import it's database!

How Can I Delete Xampp Permanently on Mac Os?

I used Xampp and deleted it.
Then, I tried to use Mamp. There is an error that I don't understand.
Mamp is working perfect as webserver. But if I want to use phpmyadmin, it doesn't work.
For example, I insert something to database. It isn't showing in phpmyadmin.
It is saving to old Xampp database although I deleted Xampp. How does it happen?
How Can I delete Xampp permanently(with mysql) on Mac OS?
XAMPP 5.x:
You can find uninstall.app in /Applications/XAMPP.
After running this program, then you can use this command to delete all XAMPP cache files: sudo rm -rf /Applications/XAMPP
XAMPP 7.x:
Open Mac OS Finder and go to /Applications folder. You should find an XAMPP icon there (eg. XAMPP.app), right-click it and choose 'Move to Trash'.
In addition to this, you might want to delete the ~/.bitnami folder within your home directory.
the newer version of XAMPP include uninstaller apps, you can find it inside XAMPP folder in Application directory. But they leave empty XAMPP folder.
To Delete XAMPP
Step 1:
Go to your Application folder and delete it.
Step 2:
Open your terminal and type: sudo rm -rf ~/.bitnami
To uninstall XAMPP-VM, follow these steps:
Delete the XAMPP-VM icon from the Applications folder.
Remove all XAMPP-VM data by deleting the ~/.bitnami folder within your home directory on the OS X host.
https://www.apachefriends.org/faq_stackman.html
I think that just put the application (in your Applications folder) is enough. But you can try to search some XAMPP garbages.
Open your terminal, sudo and search for something containing XAMPP:
sudo -s
[ Type your password ]
find / | grep -i xampp
It can take a time if you do not have a fast hdd.
This will display all files/folder containing XAMPP in their name.
Open Spotlight and search for XAMPP,
To open Spotlight, click the magnifying glass icon in the upper-right
corner of the menu bar, or press Command-Space from any app.
Should be displayed some folders. Check for XAMPP (in upper cases) folder and open it.
XAMPP folder should contain an uninstall programm, tap on it and follow the instructions.
For a complete remove Go to Macintosh HD and delete the folder /Aplications/XAMPP (Be careful with you application files).
I did it right now and it works.
it's easy pro,
Open the application folder.
Click on the XAMPP icon and hold it.
Drag the icon to Trash.
Clean Trash (to do it just hold Ctrl and click on “Empty Trash”).
run this command on the terminal:
rm -fr ~/.bitnami/

Run a shell command as another user or change Apache's user?

I've been trying to figure out how to do this the whole day.
The short version: I have to manage some virtual machines using php shell_exec function, so far I cant do this because apache is run by the user www-data and virtualbox by the user vboxuser
From what I've read so far, I've thought of 3 possible solutions:
1.- Create a script on my vboxuser that I can call from php to manage the Virtual Machines.
2.- Change the apache user from www-data to vboxuser so I can manage the Virtual Machines through php
3.- Reinstall VirtualBox, this time using www-data as my user.
I'm not sure if any of these will work and I'm not too sure of which would be the best solution. Any suggestions/ideas?
Thanks in advance.
Now the longer more detailed version:
I have a remote server running Ubuntu 10.04.2, in that server I have set up VirtualBox so I can run several instances of WinXP to perform different tasks.
Everything is setup and I can manage the virtual machines through SSH. If I want to run them as a different user than the one that created them (a user that so far only has been used to create the Virtual Machines) I have to do sudo -u vboxuser.
Now, I need to create a PHP script to manage these virtual machines (I know about phpVirtualBox, but it's not what I need). If I try to run the virtual machines using shell_exec() from php, I get no answer at all (And I have tested that shell_exec is working on my server).
you can configure sudo to allow www-data to execute commands as vboxuser
use sudo visudo to add a line to /etc/sudoers like
www-data (ALL) = (vboxuser) /usr/bin/vboxmanage
check man sudoers for more information
To change the apache user, you can edit:
/etc/apache2/envvars
And change APACHE_RUN_USER=root
Or you could execute it from root's cron
sudo crontab -e
HTH

Categories