Jump to content

Search the Community

Showing results for tags 'apache'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 8 results

  1. Hello, There is one php file, the logic is when this code is executing it is getting some data and place in DB, The problem is that when this file I executing from browser, it is working, but when I execute this file from linux shell (as apache user, or root user) like "/usr/bin/php script.php", It is not working, but without any errors. Please advise what I am missing. P.S. Centos8, apache, php 7.4.9
  2. The server is AWS linux apache running PHP, with me the sole developer as owner ec2-user. Objective: To upload files from the app user's browser (handled) to a temporary directory (/test_sub below) within the /html tree, then for security purposes, to have PHP move this file to outside the /html tree (/private_sub below) where it will remain unable to be read, written to or deleted except when the app requires PHP to do this. The app needs PHP to make any directory permission changes via chmod, and perhaps owner changes and group changes (preferably not the last two). Here is the directory structure and SUDO output to accomplish this: /var drwxr-xr-x 21 root root 4096 Dec 11 19:23 /var /www drwxrwsr-x 11 root www 4096 May 1 16:50 /var/www : /html drwxrwsr-x 5 root www 4096 Apr 25 19:51 /var/www/html : : /AWS_s drwxrwsr-x 8 ec2-user www 4096 May 1 16:54 /var/www/html/AWS_s : : : /test_dir drwxrwsrwx 3 ec2-user www 4096 May 1 16:52 /var/www/html/AWS_s/test_dir : : : : /test_sub drwxrwsrwx 4 ec2-user www 4096 May 1 23:14 /var/www/html/AWS_s/test_dir/test_sub : : : : : /test_file.txt -rw-r--r-- 1 ec2-user www 13 Apr 24 13:36 /var/www/html/AWS_s/test_dir/test_sub/test_file.txt : : /private_dir drwxrwxrwx 3 ec2-user www 4096 May 1 21:02 /var/www/private_dir : : /private_sub drwxrwxrwx 2 ec2-user www 4096 May 1 21:19 /var/www/private_dir/private_sub : : : /moved_file.txt -rw-r--r-- 1 ec2-user ec2-user 13 Apr 24 13:36 /var/www/private_dir/private_sub/moved_file.txt : : : /copied_file.txt -rw-r--r-- 1 apache apache 13 May 1 23:49 /var/www/private_dir/private_sub/copied_file.txt : : /private_sub2 drwxr-xr-x 2 apache apache 4096 May 2 00:18 /var/www/private_dir/private_sub2 The PHP scripts are run in the /test_sub directory. The default permissions for directories are drwx rws r-x 2775. Only when the /private directories are both set to 777 and the setgid is unset will they allow files to be written to them. When the two /test directories are set to the default of 775 with the setgid set, they allow files to be copied from them. However, when the move (rename) script is run, the delete function of the copy and delete process throws an error unless both /test directories are reset to 777 clearly allowing files to be deleted. I'm concerned that the /test and /private directories need to be 777, opening them up to bad actors. I've spent days researching and testing many options but have failed to resolve this. Clearly, I'm missing something fundamental here My questions: 1. Why do the two /test and the two /private directories need to have the 'other' set to rwx? I read that PHP uses group www and therefore that group www should allow the writes in the /private directories and the reads and deletes in the /test directories. 2. Why does copied_file.txt have owner:group as apache:apache instead of ec2-user:www and likewise when I mkdir /private_sub2 in PHP? 3. Why does moved_file.txt have owner:group ec2-user:ec2-user instead of ec2-user:www? 4. Why did PHP mkdir create the non-default permission 0755 in /private_sub2? 5. Why, using PHP, do chown, chgrp and chmod fail to make changes to /private_sub/moved_file.txt?
  3. how can I rewrite localhost/base/stage/Major.php to main-shop my htaccess file is located in folder base together with the index file and has this in it RewriteRule ^my-shop/?$ /stage/Major.php [R=301,L]
  4. Hey there, I'm pretty new to this proxy server thing and planning on getting some kind of deggree/major in computer science and I have made some pretty substantial progress just by doing some fairly superficial research. I've succesfully set up my phproxy and everything works reletively fine, except for social media sites such as facebook, twitter, myspace, etc. whenever I try to go to these pages via my proxy, it loads just fine but the screen is blank; no logos or information of any type is displayed on the browser when I attempt accessing these sites. However youtube works just fine without a problem. When I initially set up the server I had to edit the Apache program on my computer server to allow access. Thats when everything started working correctly except for the display screw up on social media sites. Any ideas on how to make the damn thing display would be graciously accepted lol. for the life of me ive tried screwing with everything and even different phproxy programs. Thanks! ~~This kid P.s my OS is Widows 7 and ive tried on multiple browsers. also if yall have questions on info that ive provided, or havent, please dont hesitate to ask.
  5. Hi all, I've done something similar with my wp-content folder where I protect the files from being downloaded if you are not logged in and everything works just fine. With the following code I am trying to say: #if the user doesen't have the cookie "wordpress_login_in" # and the url is wp-json ... # redirect to google RewriteCond %{HTTP_COOKIE} !.*wordpress_logged_in.*$ [NC] RewriteCond %{REQUEST_URI} ^.*wp-json/wp/v2/(users|comments|posts|pages|media|types|statuses|taxonomies|categories|tags|settings) [NC] RewriteRule ^ http://www.google.com [NC,L] Can anybody tell me why the script doesn't work? I am still seeing the JSON file (i have tried redirects from files and folders and everything seems okay. I've also tried creating wp-json folder but then that breaks the api from displaying)
  6. Ever have one of those problems that makes no sense? Yep that's me for the past 2 days... I've had apache/php stack set up on my osx machine for at least 6 years with little to no problems. I had all of my v-hosts for local sites under /etc/apache2/other (they were included via httpd.conf) All of a sudden my local sites stopped working and after tracking down the problem by using: >sudo apachectl -t I found out that my v-hosts where no longer there... heck the whole directory /etc/apache2/other was missing. Now I'm quite sure I did not touch this...the question remains... what the hell happened? Now I'm not foolish enough to think someone is going to be able to tell me what happened precisely but some insight would be nice: Has this happened to any of you before? Did osx auto update something and wipe things out? I mean ... I didn't update to a major release... still on El Capitan. Was it an automatic xcode update? I'm very baffled right now.
  7. Say below is my normal html href link. How would you turn this into a pretty URL using .htaccess? Also if I understand it correctly, this link will also have to be changed to match the pretty url. What would the new link look like? <a href="shop.php?type=45&name=belts">Belts</a>
  8. Hi there, I'm fairly new to sever management and apache. I'm having issues with curl requests on my website and i'm been told to: However even with searching online I can see how to add the exceptions for pages ending in certain file types and not for the exception mentioned above. Here is my HTACCESS FILE: # STARTNITRO RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}] ExpiresActive On #CSS JS XML TXT - 1 WEEK <FilesMatch "\.(xml|txt|css|js)$"> Header set Cache-Control "max-age=604800, public" ExpiresDefault "access plus 1 week" </FilesMatch> #JPG JPEG PNG GIF SWF SVG - 1 MONTH <FilesMatch "\.(jpg|jpeg|png|gif|swf|svg|JPG|JPEG|PNG|GIF|SWF|SVG)$"> Header set Cache-Control "max-age=2678400, public" ExpiresDefault "access plus 1 month" Header set Last-Modified "Wed, 05 Jun 2009 06:40:46 GMT" </FilesMatch> #OTF WOFF TTF ICO PDF FLV - 1 MONTH <FilesMatch "\.(otf|ico|pdf|flv|woff|ttf)$"> Header set Cache-Control "max-age=2678400, public" ExpiresDefault "access plus 1 month" </FilesMatch> # ENDNITRO # STARTCOMPRESSNITRO RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(\/?((catalog)|(assets)).+)\.css$ assets/style.php?l=4&p=$1&c=604800 [NC,L] RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(\/?((catalog)|(assets)).+)\.js$ assets/script.php?l=4&p=$1&c=604800 [NC,L] AddType image/svg+xml .svg AddOutputFilterByType DEFLATE image/svg+xml # ENDCOMPRESSNITRO RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] # SEO URL Settings RewriteEngine On RewriteBase / RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] I would really appreciate if someone could walk me through the code to modified to an the above exceptions. I believe it would be the following code I would need to edit: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] But like I mentioned i'm not entirely sure.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.