How to access written file into /var/test/ [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
If i write a file into /var/test, how can i access it through the website?
Because from having a look at the directories, the file needs to reside in /var/www/html/ so i can access it through the url.
for example if i were to write into /var/www/html/directory/file.txt all i'd need to do to access it is visit the following url:
www.example.com/directory/file.txt. But i'm not sure how to do this when writing to /var/test/file.txt.
Thanks to anyone who can help.

You can't access it via the website, unless you configure the server to allow it. Which is a good thing so your web server doesn't expose all of your files to the internet.
See the Documentroot and Alias Directives in the Web server configuration (assuming you're running apache).

this is a web-server setting, for apache see http://httpd.apache.org/docs/2.2/urlmapping.html

Related

How do I block unknown calls to my sites? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have some security issue with my website. It started by creating wp-admin directory on my FTP server with malicioust .txt file. index.php was also changed (some code at the beginning was added)
I changed all passwords and completely deleted the CMS folder from the server. I removed also wp-admin directory and malicious code from index.php
Lots of unauthorized connections to my website started with this change.
Detalis here:
database log
All calls to .shtml files were blocked by .htaccess file.
Unfortunately there are still attempts to access other resources
for example:
/wp-load.php?daksldlkdsadas&
/ajax-index.php?url=http://domainnamespace.top/lf.jpeg
/aindex.php?daksldlkdsadas&
/wp-load.php?WordPress=newzealandpolicy.wang/popn.txt&Database=1index.php
/sitemapimages79.xml
/sitemapimages5.xml
How can i prevent this calls?
What kind of attack is it and what is its purpose?
It's not wordpress based website

Loading php extension for specific domain only [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have a dedicated LAMP server with more than one domains hosted. I want to load a php extension only for a single domain. Is it possible?
Edit your VirtualHost configuration.
Make a copy of php.ini file. Add the extension you need in there. Store it in separate directory.
Use PHPIniDir in your config for the particular site and point to that new dir, containing new php.ini
Restart apache.
Your config will be loaded and will use separate php.ini file.

Configuring web server for laravel? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm using isp config but all my larval stuff is in a public folder and iso config points to a web folder.
Does anyone know how I can go about changing this?
In ISPConfig:
1) Select the site
2) Choose options
3) In the Apache Directives box type the full path of your Document Root pointing to /public:
DocumentRoot "/the/absolute/path/of/the/laravel/directory/public"

Avoid user to go ../../ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have LAMP installed in my server and I use virtualhosts to map domains to subdirectories. I need to allow my customers to upload files (including php) to their server using FTP.
The problem is that a customer using a domain xxx.com.br uploaded a file test.php and executed it like:
xxx.com.br/test.php
The content of test.php if file_put_contents("../../xxx.txt","teste") and it worked! The file xxx.txt was created 2 levels above his domain folder! How do I prevent this from happening?
Don't give the PHP process access to directories it isn't meant to reach.
That's kind of the point of the whole permission system.
In Linux, PHP will generally run as its own user, just make sure that user doesn't have read or write permission to any files you don't want exposed.
For this purpose exists open_basedir configuration directive. More information about it for example here.
Moreover it is good to use FastCGI which allows each script to be run under its owner. More information about it for example here.

Making apache to accept all subdomain requests that are not registered [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
How to configure apache to accept all subdomain request that including unregistered subdomains. Is there any way for doing this?
The answer is to simply not setup vhosts. Alternatively, you can set up a default vhost. From the documentation:
<VirtualHost _default_:*>
DocumentRoot /www/default
</VirtualHost>

Categories