fix file permission to read write access squid configuration via php code in linux server centos with lamp setup - linux

For my new project i have to configure cent os linux server with lamp setup and install squid proxy server. Installed machine will act as a server in client side. The main purpose of the count the amount of bandwidth, their mac address , ip address will be logged in server it is will act like a proxy server. Every user will be assigned with bandwidth, total browsing hours, username, password etc.
Each user can access INTERNET via installed proxy server after logging with the username and password defined to them.
User management, mac address, ip addreess fetching all will be done using php code with linux command enabled for mac address from client machine and also for blacklist website filter.
For every action of this project have to access squid configuration file located in /etc/squid/squid.conf for enabling internet support with mac filter and even iptables.
But when my php code try to access the /etc/squid/squid.conf for processing . It is unable to access the file for read, write, append operation.
In my server side i have define the file permission for /etc/squid/squid.conf with read write access with the code executing in my linux server
chmod 777 /etc/squid/squid.conf
After assign the permission also the person logged in to the server unable to access the squid file for processing.
Even the tried
chmod 666 /etc/squid/squid.conf
but no help
How i have to configure my file permission for /etc/squid/squid.conf so even my i logged user via apache server can access the file for processing

is selinux running ? you can temporary disable it with
setenforce 0
selinux may block apache to read your squid config as they are in 2 differents context even if the file is 777 and apache was running as root(bad ideal) . Here some redhat documentation about squid and selinux doc

Related

Login to Linux server with SUDO via Bitwise SSH client

I have been using Bitwise SSH client to transfer files etc on a Linux server.
I now have a new Linux server, and need to change my level of access via SUDO. I'm not sure how to do that with this client.
Is there a config I can use that automatically elevates my access using SUDO?

How to join an BITMAIN Antminer to a Microsoft Windows Server 2008 Active Directory

Let's start with "WHY?":#nerdsLoveToStartWithWhy
I'm developing a customized software to manage a crypto-mining farm where we need to communicate with miners (BITMAIN Antminer) by their hostname instead of IP (just for ease of use).
I know! But I don't want to scan IP ranges, then either SSH to them or use API to pull out the information such as the hostname
My Solution:(please share if you have a better solution)
I've configured a Microsoft Windows Server 2008 Active Directory & DNS with a domain name as ts.facility.com and I'm trying to join my Antminers to this domain.
Scenario:
The SRV1 is my AC DC and visible to the miners. The miner with a hostname as antMinerThree which is running a linux Angstrom V2013.12 are getting reply from the ACDC with its FQDN. the ntpdate package is installed as perquisite:
command: #opkg install ntpdate
Problem:
The problem for now is that when to install required packages:
samba
krb5-config
krb5-user
winbind
libpam-winbind
libnss-winbind
I got the following error: bmminer.list
Failed to open //var/lib/opkg/info/bmminer.list: No such file or directory.
and when I created manually an empty file bmminer.list in the path /var/lib/opkg/info/ I still get this error message, unless it no longer complains about missing bmminer.list:
Question
Does any body know, how to install required packages to joint this miner running Linux Angstrom V2013.12 to a Microsoft Windows Active Directory 2008 in order that I could ping my miners by hostname instead of by their IP addresses?

How to access ui of xampp running on linux command line

I have installed xampp on linux (command line version with no gui).
I am using Amazon Linux AMI.
The installation is successful and i got xampp up and running.
$ sudo /opt/lampp/lampp start
Starting XAMPP for Linux 5.6.14-4...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
However i am not able to access the xampp ui from browser.
I am accessing http://(public ip of the linux ami)
Is there anything else required to access the ui.
I did some R&D around the problem and found out that the security group (linked to the amazon instance) did not allow http traffic.
Edited security group to allow http traffic and issue was resolved.
XAMPP UI can be accessed now using the public DNS or public IP.

FTP From Local Desktop to Server As Sudo User

I have a file on my desktop that I need to FTP to a server. As I've been navigating this server, I need to login with initial credentials to access the box and then needed to run sudo -u [username] ksh to access the folder I need. (No password)
In Filezilla however, I only enter credentials once and therefore, don't have the option to sudo as the user and get permissions to the folder.
Am I going about this process wrong and if so, what's the usual way to do this?
There is no way to switch user on the ftp protocol. You need to know the correct credentials in the first place.
The closest you could come would be to ftp the files to a directory you do have access to, log in with a shell, and then move the files using shell commands after switching user.

403 Forbidden trying to access folder on browser

I have a folder in ~/Documents/WebD/ named Tarea which have a public_html folder inside, to access it I have tried creating a virtual host in a thousand ways but it didn't work, now I'm trying to get there creating a Symlink from tarea to /var/www/html/tarea, and accessing via localhost/tarea/public_html but y get
Forbidden
You don't have permission to access /tarea on this server.
Apache/2.2.15 (CentOS) Server at localhost Port 80
I tried a lot of different ways named on forums, changing httpd.conf, give permissions to apache, etc, but non of them worked
Any suggestion?
It could be SELinux preventing Apache from accessing those files. I would try switching SELinux into permissive mode and seeing if your permissions open up. You can read more about SELinux and Apache here.
To put SELinux into permissive mode, do:
echo 0 > /selinux/enforce
To put SELinux back into enforcing mode, do:
echo 1 > /selinux/enforce
Hope you have already checked Persmissions for /tarea folder. The User which is running the Apache server should have read/write permissions on the specific directories.

Resources