Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
That is nice, but none of that answers any of the questions asked, it redefines and confuses the problem.
That is too much of a moving target for me to try to follow.
You are still asking about path aliases not working, but you have also mentioned that virtual hosts and PHP are not working... it is not possible for anyone here to understand what the actual problem(s) might be from the descriptions posted here.
I would suggest that you approach the problem systematically, from the ground up.
1. Get the web server working with a simple document root path and a simple HTML test page...
2. When that is working reliably, add your virtual host(s) and verify they resolve correctly...
3. Enable PHP in the desired virtual host(s) and verify that it works as expected...
4. Add an Alias directive, verify it does not break anything previously working, and works as expected...
When you get stuck at some point return to ask for help with a clear description of what does and does not work and post only the relevant portions of your config files in line here. (Note: Posting your complete configs to PasteBin is not a very good option for yourself or for those offering help. Doing so allows you to skip identifying and extracting only the relevant parts which is the best troubleshooting exercise for you, and asking others to read your complete configs and troubleshoot them for you is not how LQ works.)
Try that and see if you can reach a better defined condition - or maybe solve all the problems in the process, which is the best outcome!
I went to "fstabs" and entered the 3 TB drive so now on boot it mounts as just "3T". Now my aliases.comf file reads for one new link:
Which should assign the declared directory to "localhost/WRU" in the browser, but it is not and also not rendering any of the .PHP files, which is declared in the /etc/apache2/apache.conr file.
Not really sure what you are asking, but that is my understanding of an alias!
Cheers!
TBNK
It has been years since I managed a web server, but I think you need to read and understand exactly how aliases work on a web server. With apache each alias gets its own directory tree, usually under /var/www, and it has to be properly configured in the apache config for the path used for that web sites files, complete with hostname used, etc.
The directory? localhost/WRU possibly has no real meaning to the web server since localhost is a defined name for that machine on the 127.0.0.1 address, and apache does not (if configured properly) listen to that IP.
Dig a bit deeper in how to configure apache, the directory structures to use for the aliased hosts on that web server, permissions needed, and then set it up properly. For security purposes apache is almost never allowed to serve public web pages from any part of the directory tree outside of /var/www (or /www on some systems) if the server is accessible from the internet.
The main config directory for httpd on my system is /etc/httpd/conf and the man page for the config file is "man httpd.conf". Both /etc/httpd/conf/httpd.conf and the man page for that file have a lot of detailed info on how to set things up, complete with examples, so read up and follow the directions.
With your lack of understanding about mounting a filesystem and the problems you encountered there I think it likely you need to take things slow and try to fully understand things before you really open up a major security hole on your system. Studying a little will help you ask better questions as well, instead of needing us to hold your hand for every step of the way.
If you need more reference material Oreilly has at least a dozen books about web servers, and I think a good start would be the one titled Apache.
Last edited by computersavvy; 10-22-2020 at 11:26 PM.
All the Apache docs say that multiple drives, mul6tiple sites, multiple aliases are supported, so since I've exhausted myself following multiple HOWTOs that say "It WOrks", I've posted my 4 files in the pastebin at:
Still do not have Apache working right. I'm not good at Virtual Hosts and think that is where the problem lies as I need to still have "localhost" in /var/www (not /var/www/html) and then need to access the /3T drive as a seperate Virtual host, so reading up on that and hope to get it working soon.
Any shortcuts you know to help with this would be great right now and much appreciated!
Nothing is added to the apache error log, but getting this error msg, when I start apache:
Quote:
service apache2 start
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
Not sure what this means! Submitted to Google and then ran cmd:
systemctl status apache2.service
Getting errors of:
Quote:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Fri 2021-01-01 08:36:46 CST; 4h 4min ago
Process: 25769 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Jan 01 08:36:46 TBNK-SVR systemd[1]: Starting The Apache HTTP Server...
Jan 01 08:36:46 TBNK-SVR apachectl[25769]: apache2: Syntax error on line 53 of /etc/apache2/apache2.conf: Syntax error on line 7 of /etc/apache2/sites-enabled/000-default.conf: Expected </Directory/> but saw </Directory>
Jan 01 08:36:46 TBNK-SVR apachectl[25769]: Action 'start' failed.
Jan 01 08:36:46 TBNK-SVR apachectl[25769]: The Apache error log may have more information.
Jan 01 08:36:46 TBNK-SVR systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 01 08:36:46 TBNK-SVR systemd[1]: apache2.service: Failed with result 'exit-code'.
Jan 01 08:36:46 TBNK-SVR systemd[1]: Failed to start The Apache HTTP Server.
Edited the 2 erroring files; then restarted! Took me 3 tries to clear all the errors, but now apache is working as well as the 2 virtual hosts I declared, but my aliases still are finding the /3T drive.
Edited the 2 erroring files; then restarted! Took me 3 tries to clear all the errors, but now apache is working as well as the 2 virtual hosts I declared, but my aliases still are finding the /3T drive.
Nor does PHPmyAdmin come up!
Cheers!
TBNK
Simple.
Keep working on the config, and focus on only one problem at a time.
The files in /etc/httpd/conf.d (which should be where you have the config files for the aliases) need to be reset so each alias has the proper path to its home directories. Once that is fixed then worry about PHPmyAdmin last.
Remember that each time you make a change in an config file for httpd, you need to restart httpd before the change takes affect.
All the aliases are incorrect as I originally had the aliases.conf file in the /etc/apache2/conf-available directory and now not sure if I just rename it/copy it or have to put them (now 3) in different directories.
Simple.
Keep working on the config, and focus on only one problem at a time.
The files in /etc/httpd/conf.d (which should be where you have the config files for the aliases) need to be reset so each alias has the proper path to its home directories. Once that is fixed then worry about PHPmyAdmin last.
Remember that each time you make a change in an config file for httpd, you need to restart httpd before the change takes affect.
Sorry but I'm a conceptual person, and none of the concept comes through in any of the Apache docs or HOWTOs I've been reading. Sure it's really simple once I get the concept.
Sorry but I'm a conceptual person, and none of the concept comes through in any of the Apache docs or HOWTOs I've been reading. Sure it's really simple once I get the concept.
TBNK
1. Have you been looking at the logs in /var/log/httpd to see what they might tell you? Properly set up there should be separate logs for each aliased web site. Reading the logs should educate you on what is actually happening.
2. Have you tried disabling the virtual hosts (aliases) and confirmed that everything with the main host web pages is working correctly?
Once that is confirmed then
3. Enable one of the aliases and make certain it is properly configured and serving the right pages, including that it reaches the proper data and returns the proper identification to the asking page.
finally,
4. Once you have worked out the issues with one of the aliases you will have an idea of what to do with the second aliased web pages.
Every task needs completed one step at a time and task 1 is getting the main server site fully functional. Tasks need completed one at a time in sequence as well
The default /etc/httpd/conf/httpd.conf file has lots of configuration information to properly set it up for the main server.
A copy of most of that file properly set up for the filesystem path to the alias1 data and placed as /etc/httpd/conf.d/alias1.conf configures the aliased web site. One of the important things is the listen directive in that file. It has to be matched to the interface/IP it listens on so the connection is known to be for other than the main server. As a result it requires some appropriate matching network config as well.
The gurus on the #httpd channel at irc.freenode.net point me to all the Apache docs but I cannot find a single item/article on defining a virtual host outside of /var/www and 100% of my websites and projects are on my 2nd 3TB HD, defined in fstab as /3T/ to autoload on bootup.
I know it is possible because 100% of hosting servers at the hosting houses use typically over 6 drives including RAID arrays, and have most of the accounts on these extra drives.
Sure wish I could find these answers! All help appreciated!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.