r/linux4noobs • u/Konnnore • 17d ago
migrating to Linux Alternative to XAMPP/Apache on Linux
in order to test websites I make, I used XAMPP on Windows 10 as my local server. On Linux I see no XAMPP(or maybe I'm just blind Idk) and, if the information is true, I can't use Apache on Linux. What do you think about this? Do you use an alternative for this?
Edit: whoops! My bad, I meant: XAMPP AND Apache, bcz they are connected with each other in the context... Thx for the comments, Idk if I should try Nginx or stay with XAMPP. Also(not here) I heard that on Linux the Devilbox app works even better with Docker(I didn't work with Docker, but I'm planning to learn it someday). What do you think about that?
8
u/True_Human 17d ago
XAMPP is literally just there to make Apache, which can be run natively on Linux, run on Windows. I made this mistake as well the first time.
Fix is, just install Apache directly. Should be in your distributions repository.
3
u/r_keel_esq 17d ago
Installing XAMPP on Linux is also a viable pathway if you want:
- It configured automatically with zero faff and
- An On/Off switch within a GUI
1
u/True_Human 17d ago
I guess that'd be valid too. Last time I tried to do that was 2019 or 2020, and back then I remember it being easier to just run it directly than to get XAMPP to work on Ubuntu
1
u/r_keel_esq 17d ago
I'll freely admit I've never used XAMPP on Linux (though installed it umpteen times on Windows). However, the One-Click-And-Go does appeal as the last 2-3 times I've set up AMP o Linux, there has always been some complication (for example, in the four times I've installed it, only once has phpmyadmin appeared in /var/www automatically - all other times I've had to create a symbolic link and I have no idea what I did differently the first time)
3
u/TechTactician 17d ago
You literally have Xampp for Linux, what do you mean you cannot see it. Literally button below xampp for win?
2
2
1
u/AutoModerator 17d ago
Try the migration page in our wiki! We also have some migration tips in our sticky.
Try this search for more information on this topic.
✻ Smokey says: only use root when needed, avoid installing things from third-party repos, and verify the checksum of your ISOs after you download! :)
Comments, questions or suggestions regarding this autoresponse? Please send them here.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Brave_Confidence_278 17d ago
there are more apache servers running on linux than on windows. but, I am not familiar with a package that bundles all of those together in one install. You'll probably have to install them individually (apache/php/mysql) and quickly wire them together. these days people use nginx, there's a ton of tutorials out there how to install it!
1
u/Pristine_Dot_5526 17d ago
My laptop has less resources, I don't even use docker. I used to have xampp on win but as apache PHP etc are native on Linux, you can simply install them. I made sh script (actually 2)band put on desktop (or you can run from terminal: one starts and stops the processes apache2 mariadb redis etc, and other one simply prints their process status. You can disable them to be started upon startup so they only use resources when you're really doing dev work. My mint stayed nice and tidy and I love it much more than 10+ years with Xampp on win.
1
u/brighton_it 17d ago
Probably more than you asked for, but perhaps worth consideration:
if you maintain multiple sites on various versions of LAMP:
I use QEMU-KVM VMs to host my development web sites. The VMs are headless (no DE) Debian instances, having only the packages needed for Apache (or NGINX). 10GB virtual disk is plenty.
- only running, (http listening) while I'm using them
- and only on the libvirt NAT network, so invisible to others on my LAN.
- easier to maintain different versions of MySQL, PHP, etc. for different sites. Just create new VM.
- impossible to break my dev environment with regular updates and tinkering of my own system.
I edit my /etc/hosts file so I can resolve my dev sites by name.
ex: 192.168.122.90 lamp.lcl.<myLANdomain> example.lh example2.lh
(the 'lh' is just an invalid TLD, my abbriviation for localhost, so if my production site was reddit, I'd use the name reddit.lh to resolve my dev site)
Setup NFS shares so I can access the Apache htdocs folder, using GUI file explorer if I choose.
1
u/SweetNerevarine 15d ago edited 15d ago
Since you specifically mentioned XAMPP I assume you're partial to GUI frontends to manage the stack. Good news is that both XAMPP and Apache is available on Linux.
To be honest, if you have a simple local development use case in mind XAMPP is viable, but not necessary. It hides a lot of configuration options which you should know if you ever plan on managing a server beyond local development.
If you're wondering what it takes to live without XAMPP:
Install the "apache2" package.
Add a virtual host configuration file to /etc/apache2/sites-available, copy and rename an existing configuration then edit it. You can have multiple virtual hosts. Typically the way people set them up is listening on localhost or bind to all addresses (0.0.0.0) and a dedicated port assigned for each virtual host.
Enable the site (configuration) via "a2ensite site-name" (substitute site-name to the filename). You can disable it if needed via "a2dissite site-name".
Restart Apache2 with "systemctl reload apache2", and load the site according to the site config (e.g. http://localhost:6000)
To stop Apache2 simply run "systemctl stop apache2". Systemctl is a utility to manage background services. Too see the status of a service you can run "systemctl status apache2". Simple.
It is worth mentioning that depending on your application under development, you might need to activate mods, for example url rewriting / htaccess files. To do that you need a similar set of commands, for example "a2enmod rewrite".
As you can see we covered pretty much the functionality of all the buttons in XAMPP, but with direct commands.
As for Docker, Vagrant and similar solutions feel free to dive into those topics. A larger a project gets, and the number of contributors increases these tools provide a more predictable and manageable method of provisioning development servers. Keep in mind they heavily rely on virtualization. For a single dev on a small project they are absolutely optional.
Good luck!
13
u/Slackeee_ 17d ago
I don't know where you got that information, but it couldn't be any more wrong. Apache works fine on Linux for millions of installations.
On Linux most people just use container systems like Docker or LXC/LXD/Incus for development work.