Perl or bash script to redirect traffic to another site.
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.
The BASH script is not right. It does not edit httpd.conf file as required. Any suggestions?
Yes; hire someone to do this. You posted the 'old' script, implying there is a NEW script. You STILL haven't answered many of the questions you've been asked, are STILL not providing any details (such as what the script is doing/results/etc.), and you STILL have no clear goal or idea what you want to do or why. Saying "not right" tells us nothing.
You are not paying attention; you are not listening and apparently WILL NOT do either of those things. There is nothing anyone here can do to help you.
The OP is probably trolling and should be ignored. If they're not, and this thread is actually driven out of a desire to help, that's great - but it is an incomplete and technically illiterate idea that will not work.
The best thing Fred27377 can do is to find another avenue to help people. Something which involves things they are already capable of doing.
(The best thing the second-most-vocal user in this thread can do is pretend the thread is closed and stop replying already.)
I got someone to do this. I still want to accomplish up to 1000 sites on a VPs. The reason I refer to this is because I have come up with the idea of using a client side script per each individual user. I didn’t think about this when I started or I would have mentioned it. I want to get this to work before I tackle anything else. Thank you for looking and thinking as everyone has you have really got me thinking. I have paid you my highest compliment!
TBOne The script should add entries in the Apache httpd.conf file. The way I read it it does not. I think it should add files as well but I haven’t fleshed that one out yet.
OP. Tinker with it until it works...consider that you need to use the /path/to/httpd.conf in the script in order for the script to update httpd.conf. Backup the httpd.conf first.
Again, adding subdomains to the httpd.conf will NOT do anything if there is no DNS to resolve to the web server for each subdomain.
Those things said, I agree that nothing you do should be done on a server that's connected to the internet in any way.
I did a cut and paste from a different thread and I believe it applies.
Edit, this is a general statement not directed at any one person and it relates to further back in this thread.
"I feel everyone should be reminded to post on topic, to only post if they have something helpful to add, and to not post directives for the future of the thread."
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,808
Rep:
Quote:
Originally Posted by scasey
OP. Tinker with it until it works...consider that you need to use the /path/to/httpd.conf in the script in order for the script to update httpd.conf. Backup the httpd.conf first.
Again, adding subdomains to the httpd.conf will NOT do anything if their is no DNS to resolve to the web server for each subdomain.
Those things said, I agree that nothing you do should be done on a server that's connected to the internet in any way.
If the OP wants to create a brazillion virtual hosts covering the entire population, I'd create individual files for each under `/etc/apache2/vhosts.d' and use the IncludeOptional directive to suck in `*.conf' when Apache starts. At least that's the way OpenSUSE has configured Apache. I'd rather do that than muck around with `httpd.conf' too much.
Adding virtual hosts to Apache is the easy part. The OP's going to have to figure out how to get `bind/named' configured to pull all this off. One A record for each person in the country? Figuring out how to handle all the people that have the same name? (Or is handing over one's SSN part of the plan?) What about the privacy aspects? Got that all figured out? I'm betting "nope".
I need to go back a few squares. Will adding entries to the httpd.conf in Apache allow you the same number of virtual hosts? If not how would you do it?
320 million users.
1 subdomain per username.
1000 subdomains.
Your numbers aren't adding up.
Also, you said "Facebook does this and bit.ly does this". Neither Facebook nor bit.ly gives each user a subdomain. Just as LQ (which I might suggest as a better example) gives each user a profile page but not a subdomain.
It’s not 320000000 it’s only 1000. For me this an exercise to learn something! Why is this such a bad idea? Exactly?
All fine and good and never a bad idea to work to learn something.
To that point:
Quote:
Originally Posted by Fred27377
I need to go back a few squares. Will adding entries to the httpd.conf in Apache allow you the same number of virtual hosts? If not how would you do it?
I do not have an answer here, however I personally would try this and find out for myself, and especially "because you can".
Which is to say that you are working on this as an exercise, and you are editing the httpd.conf file. Therefore I recommend you try adding entries to it until you find out if there is a limitation. The server application which is using this httpd.conf file should also have documentation. Their documentation may contain an answer for your question about their limits. Recommend you review their documentation to see. I would not seek an alternative method to do this until you've proven that you cannot do it.
In spite of things i now have to report there are 100 separate sites that have been added to my fedora 32 VPS or box. They are sequential. But despite all the BASH coding you cannot edit them from a browser. Permissions are rwxrwxrwx. I know this is wrong but I haven’t corrected it yet.
If you type on a page it is visible. If you type index.html and all the sites have their own index.html page. I was under the impression you could do this through the browser but alias I haven’t yet.
Thank you for following my posts. I may be slow but I haven’t given up.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.