Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
-snip once again-
Another quick question (I think the site is nearly complete), how do you deal with PHP permissions when you need to write files? Up until now I've written image thumbnails with a bash script, but with the GD library for PHP I see no reason why I can't just update thumbnails dynamically, so I added a function to check/update a directories thumbnails but realized I now need more than read access, but as I understand it the PHP runs under the 'nobody' user and group, meaning I would have to set read and write for all on my server root and all sub-directories, which seems too permissive.
TL;DR How do you deal with granting PHP scripts write permissions on your Apache servers?
You can start by not running PHP under nobody. There should be a proper account that PHP/Apache runs under.
[QUOTE=compwhizii;41351821]You can start by not running PHP under nobody. There should be a proper account that PHP/Apache runs under.[/QUOTE]
Turns out the default Apache installation already created an http user and group. I just recursively changed the owner and group of the server files and everything is working great. Thanks!
Also, why is GD even a thing? The Imagick library seems far more powerful and is even object oriented.
[QUOTE=Rayjingstorm;41350535]I would have to set read and write for all on my server root and all sub-directories, which seems too permissive.[/QUOTE]
Why would you have to give write access to every directory under your sever root to save thumbnails? You just need write access to the directory the thumbnails are going in to...
Speaking of isolated PHP sessions, anyone know some minimum hassle ways to do that with php-fpm on nginx?
[QUOTE=KmartSqrl;41353665]Why would you have to give write access to every directory under your sever root to save thumbnails? You just need write access to the directory the thumbnails are going in to...[/QUOTE]
Good point, I'll keep everything else as root. In that case should I just grant write access to all in the thumbnails directories, rather than modify the user and group?
[QUOTE=Banana Lord.;41354052]Speaking of isolated PHP sessions, anyone know some minimum hassle ways to do that with php-fpm on nginx?[/QUOTE]
What do you mean?
[QUOTE=Ac!dL3ak;41354790]What do you mean?[/QUOTE]
Oh sorry, I was multi tasking when I wrote that. Isolated PHP sessions, as in every user has its own PHP session. Wordpress is being a bitch and not allowing automatic updates (without FTP) since NGINX and FPM are running as 'nobody'
Anyone know if there's a LESSCSS linting tool out there? Something that rather than just saying 'unrecognised input' goes a little more indepth.
Because looking at my code, I just cant find what's wrong!
(Obviously unrecognised input, but I can't find where.)
By the way, I'm compiling through grunt.
This question may relate more to something else related to hardware or software but web development has brought me to now ask myself. How does an array of computers process together to serve requests for a single site?
Is all the hardware collected as a single machine virtually? It sounds opposite of taking one machine and breaking it down into multiple images.
Do you end up with multiple database servers or do you scale a single one out as you grow?
[QUOTE=Epiclulz762;41376179]This question may relate more to something else related to hardware or software but web development has brought me to now ask myself. How does an array of computers process together to serve requests for a single site?
Is all the hardware collected as a single machine virtually? It sounds opposite of taking one machine and breaking it down into multiple images.
Do you end up with multiple database servers or do you scale a single one out as you grow?[/QUOTE]
I assume it's just load-balancing in cases, sending requests to different servers. With databases, it would be like replication slaves or similar. I'm not really sure.
[QUOTE=Epiclulz762;41376179]This question may relate more to something else related to hardware or software but web development has brought me to now ask myself. How does an array of computers process together to serve requests for a single site?
Is all the hardware collected as a single machine virtually? It sounds opposite of taking one machine and breaking it down into multiple images.
Do you end up with multiple database servers or do you scale a single one out as you grow?[/QUOTE]
It really depends. Often you put multiple servers behind a load balancer (either software or hardware) and schedule how you want it to distribute load.
As far as databases are concerned, it depends upon what you are using. If you use something like Redis, the only thing that it supports is master-slave replication, if you use MySQL, it supports clustering and replication. Many larger object stores (Riak, elasticsearch) do automatic clustering and use stuff like paxos to distribute requests and data.
So I have a domain that points to a IP for a game server. Can I also make that domain be a site? Like I join in the game but when I enter it in a browser I get a page?
[QUOTE=SweFox*;41379216]So I have a domain that points to a IP for a game server. Can I also make that domain be a site? Like I join in the game but when I enter it in a browser I get a page?[/QUOTE]
If they're running on the same server on different ports, yes, but you would need to use the port when connecting to the game server. I would probably just use a subdomain for the game server though.
[QUOTE=SweFox*;41379216]So I have a domain that points to a IP for a game server. Can I also make that domain be a site? Like I join in the game but when I enter it in a browser I get a page?[/QUOTE]
Yeah. You need to point the IP to a VPS/Dedicated Server/whatever and then you can do this (courtesy of [url=http://blog.softlayer.com/2011/iptables-tips-and-tricks-port-redirection/]softlayer blog[/url]) to redirect traffic that goes to a certain port to another IP address.
[quote]
But check this out: Say for example you have a website (shocking, I know). You don’t have a load balancer or a firewall set up, but you want to split off your email traffic to a second server to reduce strain on your web server. Essentially, you want to take incoming port 25 and redirect it … to ANOTHER SERVER. With iptables, you can make this work:
iptables -t nat -A PREROUTING -p tcp -d 123.123.123.123 --dport 25 -j DNAT --to-destination 10.10.10.10:25
[/quote]
So you for, I guess you could do it like this.
[code]
iptables -t nat -A PREROUTING -p tcp -d (VPS/Dedicated Server IP) --dport 27015 -j DNAT --to-destination (Game server IP):27015
[/code]
Haven't tested this, but in theory it should work.
[QUOTE=Dorkslayz;41379301]Yeah. You need to point the IP to a VPS/Dedicated Server/whatever and then you can do this (courtesy of [url=http://blog.softlayer.com/2011/iptables-tips-and-tricks-port-redirection/]softlayer blog[/url]) to redirect traffic that goes to a certain port to another IP address.
So you for, I guess you could do it like this.
[code]
iptables -t nat -A PREROUTING -p tcp -d (VPS/Dedicated Server IP) --dport 27015 -j DNAT --to-destination (Game server IP):27015
[/code]
Haven't tested this, but in theory it should work.[/QUOTE]
Well atm I'm using my hosts DNS configurator like this.
[IMG]http://swefox.me/sharex/Sq44.png[/IMG]
Could I just add the ports to the IP and thats it?
[QUOTE=SweFox*;41379392]Well atm I'm using my hosts DNS configurator like this.
[IMG]http://swefox.me/sharex/Sq44.png[/IMG]
Could I just add the ports to the IP and thats it?[/QUOTE]
No, it can't be done via DNS. If you've got a VPS or whatever that you host your sites on, then it will work.
Edit: Apparently it's dumb to say that load balancing/conditional redirection can't be done via DNS, but whatever.
[QUOTE=Dorkslayz;41379432]No, it can't be done via DNS. If you've got a VPS or whatever that you host your sites on, then it will work.[/QUOTE]
Alright thanks. Then I will make a subdomain like I first planned.
[QUOTE=SweFox*;41379216]So I have a domain that points to a IP for a game server. Can I also make that domain be a site? Like I join in the game but when I enter it in a browser I get a page?[/QUOTE]
Yeah, unless you run your gameserver on port 80 it should be 100% fine, assuming you have a VPS/Dedicated Server running both the gameserver and website.
[QUOTE=Banana Lord.;41379473]Yeah, unless you run your gameserver on port 80 it should be 100% fine, assuming you have a VPS/Dedicated Server running both the gameserver and website.[/QUOTE]
He doesn't, which is why I suggested port redirection.
[QUOTE=Dorkslayz;41379563]He doesn't, which is why I suggested port redirection.[/QUOTE]
If he doesn't then how is he going to be doing these commands?
[QUOTE=Banana Lord.;41379663]If he doesn't then how is he going to be doing these commands?[/QUOTE]
Yea, my websites are from shared hosts. My server is from the same host but its an actual dedicated server.
[QUOTE=Banana Lord.;41379663]If he doesn't then how is he going to be doing these commands?[/QUOTE]
Perhaps SweFox runs his website on a VPS, and rents his game server from another company?
[QUOTE=Dorkslayz;41380022]Perhaps SweFox runs his website on a VPS,[/QUOTE]
[QUOTE=SweFox*;41379678]Yea, my websites are from shared hosts. [/QUOTE]
[QUOTE=Dorkslayz;41380022]and rents his game server from another company?[/QUOTE]
[QUOTE=SweFox*;41379678]My server is from the same host but its an actual dedicated server[/QUOTE]
[QUOTE=Coment;41380167][/QUOTE]
I was referring to the lack of understanding when the original post was made, none of us except SweFox knew what kind of setup he had. I was trying to put forward the scenario that perhaps he hosted his game server from another company, justifying my response and potentially helping other users in the future.
[QUOTE=Shadow801;41358782]Anyone know if there's a LESSCSS linting tool out there? Something that rather than just saying 'unrecognised input' goes a little more indepth.
Because looking at my code, I just cant find what's wrong!
(Obviously unrecognised input, but I can't find where.)
By the way, I'm compiling through grunt.[/QUOTE]
Just in case anyone was wondering, I used RECESS.
I have a server running. It's mainly a seedbox but recently I discovered I have about 80 MB of access logs.
Now most of it seems to be crawlers and bots, how do I look at and sort that stuff?
[QUOTE=Killuah;41384475]I have a server running. It's mainly a seedbox but recently I discovered I have about 80 MB of access logs.
Now most of it seems to be crawlers and bots, how do I look at and sort that stuff?[/QUOTE]
There are various log parsers available, some quick Googling [url=http://webmasters.stackexchange.com/questions/4852/what-is-the-best-apache-logs-analyzer]found a thread about this for Apache[/url].
So I bought my first domain at namecheap.com and am using dreamhost as a webhost. This is my first time trying to do something like this. I can't transfer the domain to Dreamhost until 60 days is up so I forwarded the the 3 DNS addresses of dreamhost through namecheap's menus. Buuuut I can't get the status of my domain to become "registered" on dreamhost which would allow me to install wordpress and whatnot.
Like I should be able to select my domain from a dropdown menu as shown at 3:45 in this video:
[media]http://www.youtube.com/watch?v=wt1O8UmpSeQ[/media]
Any ideas? I think it has to do with my domain not being officially registered through them. Do I really have to stick it out 60 days before I can touch the thing?
Sorry, you need to Log In to post a reply to this thread.