How do I make Apache follow symlinks in an OSX / XAMPP environment? - linux

I've been trying to get Apache to follow symlinks. I am getting an "Access forbidden!" message.
I understand this is likely a permissions issue.
So far I have tried:
Setting the source directory to chmod 777
Adding the xampp/apache user 'nobody' to the groups 'admin' and 'staff'
Both symlink and apache alias directives (both give me the forbidden message)
Source:
1228833 drwxr-xr-x 27 eric staff 918 Jun 1 09:55 .
332009 drwxr-xr-x+ 40 eric staff 1360 May 22 10:41 ..
1228879 -rw-r--r--# 1 eric staff 24580 Jun 1 09:55 .DS_Store
30604402 lrwxr-xr-x 1 eric staff 93 Jun 1 09:07 YellowFinTunaPages -> /Users/ericmiller/Dropbox/_iSirona/iSirona Product Development/Prototypes/YellowFinTunaPages/
Destination:
30602721 drwxr-xr-x 4 eric staff 136 Jun 1 09:10 .
1286885 drwxr-xr-x# 11 eric staff 374 Jun 1 09:04 ..
30606068 -rw-r--r--# 1 eric staff 6148 Jun 1 09:10 .DS_Store
30602745 drwxrwxrwx 10 eric staff 340 Jun 1 09:05 YellowFinTunaPages

Turns out access permissions for a folder depend on the folder above it. I didn't realize this. I had to chmod 755 the whole preceding directory tree. I wish there were a better solution--I don't actually want to allow broad access to that whole tree, just the subfolder.
Apache won't follow symlinks (403 Forbidden)

Related

How to flash MB1355C and/or MB1293C from the STM32WB55 Nucleo Pack on Linux?

I would like to program the (MB1355C and/or MB1293C) devices from an STM32WB55 Nucleo Pack on my (Ubuntu 18.04.3 LTS) machine - preferably with the convenience of an eclipse based IDE that supports debugging features.
I installed
STM32CubeProgrammer (version 2.2.1)
Atolic TrueStudio (version 9.3.0)
STM32CubeIDE (version 1.1.0)
and I now have the following udev rules
chandran#chandran-OptiPlex-9020:~$ ll /etc/udev/rules.d/
total 160
drwxr-xr-x 2 root root 4096 Dec 13 14:11 ./
drwxr-xr-x 4 root root 4096 Dec 4 13:44 ../
-rw-rw-r-- 1 root root 270 Oct 14 18:10 49-stlinkv1.rules
-rw-rw-r-- 1 root root 270 Oct 14 18:10 49-stlinkv1.rules.O
-rw-rw-r-- 1 root root 464 Oct 14 18:10 49-stlinkv2-1.rules
-rw-rw-r-- 1 root root 464 Oct 14 18:10 49-stlinkv2-1.rules.O
-rw-rw-r-- 1 root root 278 Oct 14 18:10 49-stlinkv2.rules
-rw-rw-r-- 1 root root 278 Oct 14 18:10 49-stlinkv2.rules.O
-rw-r--r-- 1 root root 458 Dec 11 17:26 49-stlinkv3loader.rules
-rw-rw-r-- 1 root root 845 Oct 14 18:10 49-stlinkv3.rules
-rw-rw-r-- 1 root root 845 Oct 14 18:10 49-stlinkv3.rules.O
-rw-r--r-- 1 root root 381 Dec 6 17:10 '#61-msp430uif.rules#'
-rw-r--r-- 1 root root 381 Dec 4 15:09 61-msp430uif.rules
-rwxr-xr-x 1 root root 2145 Dec 4 15:09 70-mm-no-ti-emulators.rules*
-rw-r--r-- 1 root root 58549 Dec 4 12:29 70-snap.core.rules
-rw-r--r-- 1 root root 79 Dec 5 12:11 77-msp430-blacklist.rules
-rw-r--r-- 1 root root 0 Dec 5 12:10 77-msp430-blacklist.rules~
-rw-rw-r-- 1 root root 18450 Oct 14 17:33 99-jlink.rules
-rw-rw-r-- 1 root root 18450 Oct 14 17:33 99-jlink.rules.O
I am in the dialout group
chandran#chandran-OptiPlex-9020:~$ groups chandran
chandran : chandran adm dialout cdrom sudo dip plugdev lpadmin sambashare
I downloaded an example project called STM32100E-EVAL_USART_IrDA_Transmit and it builds successfully, but I get the following error message when I connect the evaluation board(s) and click on debug to flash the micro controller
ST-Link enumeration failed
Error in initializing ST-Link device.
Reason: (2) ST-Link DLL error.
I get the same error message when I try the above with STM32CubeIDE.
I have tried shifting JP1 as described in section 7.6 of the users manual but to no avail.
A previous question on stack overflow deals with the same error message so I got STM32CubeProgrammer to launch and tried making the changes suggested by #IsaBostan, but the development boards don't seem to be detected
How can I proceed to resolve this problem and program the boards?
Debugging ideas or suggestions are welcome, even if they haven't been tested...
It was just a question of permissions as suggested by KamilCuk
Launching TrueStudio as root and then clicking on debug solved the problem.
This is what worked on my machine:
sudo su
/opt/Atollic_TrueSTUDIO_for_STM32_x86_64_9.3.0/ide/./TrueSTUDIO
STM32CubeIDE's debugger also works when launched as follows on my machine:
sudo su
/opt/st/stm32cubeide_1.1.0/./stm32cubeide
and STM32CubeProgrammer connects to the device straight away when launched as follows:
sudo su
/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/./STM32CubeProgrammer
My device shows up under /dev/ttyACM0 with the following permissions:
crw-rw----+ 1 root dialout 166, 0 Dec 28 11:56 ttyACM0
openocd and st-flash were not required.

Linux folder permissions not inherited with symfony new project

I'm setting up a new web server, and getting some issues with folder perms when generating a new symfony project.
All my websites are located into /var/www
My symfony installer is located in /usr/local/bin/symfony
And this my my symfony installer ownership and perms:
-rwxr-xr-x 1 root staff 233229 Oct 11 00:56 symfony
Here is what I did on my website main folder :
chown :www-data /var/www/
chmod g+s /var/www/
setfacl u:my-user:rwx,d:u:my-user:rwx,g:www-data:rwx,d:g:www-data:rwx /var/www
When uploading file, everything is fine, group and perms are inherited correctly.
The problem is when I generate a new symfony project with the following command while located into /var/www:
symfony new my_project
This is the project folder perms:
drwxr-xr-x 9 501 root 4096 Oct 15 00:20 test
And the perms inside the project folder:
drwxr-xr-x 4 501 staff 4096 Oct 15 00:20 app
drwxr-xr-x 2 501 staff 4096 Oct 15 00:20 bin
-rw-rw-rw- 1 root root 2032 Oct 15 00:20 composer.json
-rw-rw-rw- 1 root root 74614 Oct 15 00:20 composer.lock
-rw-rw-rw- 1 root root 248 Oct 15 00:20 .gitignore
-rw-r--r-- 1 501 staff 978 Oct 3 21:12 phpunit.xml.dist
-rw-rw-rw- 1 root root 68 Oct 15 00:20 README.md
drwxr-xr-x 3 501 staff 4096 Oct 15 00:20 src
drwxr-xr-x 3 501 staff 4096 Oct 15 00:20 tests
drwxr-xr-x 5 501 staff 4096 Oct 15 00:20 var
drwxr-xr-x 15 501 root 4096 Oct 15 00:20 vendor
drwxr-xr-x 3 501 staff 4096 Oct 3 21:14 web
ACL aren't inherited at all.
After a lookup, 501 seems to be the daemon user.
How can I fix this issue?
You need to use recursive Preciel.
Try:
setfacl -R ...
Also the commands you used sets the permission for /var/www, but nothing underneath that!

Touch command. permission denied

I was able to connect to my school server via SSH. I had an assignment in which I was supposed to use the touch command to create a new file. Yet it keeps returning permission denied. Others were able to do the same thing. Though why do I keep getting this error?
Below is what was the input from the terminal.
Last login: Tue Aug 23 09:16:18 on ttys000
Dominiks-Air:~ fsociety95$ ssh djaneka1#navajo.dtcc.edu
djaneka1#navajo.dtcc.edu's password:
Last login: Tue Aug 23 09:16:35 2016 from pool-72-94-210-193.phlapa.fios.verizon.net
Navajo is Linux shell server provided to staff, faculty, and students. The
operating system is RedHat Enterprise Linux 5.
Alpine, a Pine replacement, has been provided as a mail client. Run "pine"
at the command prompt.
This server also provides web space to users. Web pages can be stored in
the ~/www directory. This is also accessible by mapping a drive in Windows
to \navajo\homepage. The URL for your homepage is
http://user.dtcc.edu/~username/.
Your home directory is also accessible in Windows by mapping to
\navajo\.
If something appears broken or missing, please email path#dtcc.edu.
Could not chdir to home directory /u/d/j/djaneka1: No such file or directory
-bash-3.2$ touch today
touch: cannot touch `today': Permission denied
-bash-3.2$ pwd
/
-bash-3.2$ touch today
touch: cannot touch `today': Permission denied
-bash-3.2$
Edit: here is the result of ls -al
-bash-3.2$ ls -al
total 204
drwxr-xr-x 25 root root 4096 Aug 22 16:50 .
drwxr-xr-x 25 root root 4096 Aug 22 16:50 ..
-rw-r--r-- 1 root root 0 Aug 3 14:01 .autofsck
-rw-r--r-- 1 root root 0 Jan 30 2009 .autorelabel
-rw------- 1 root root 2050 Aug 3 14:00 .bash_history
drwxr-xr-x 2 root root 4096 May 4 04:14 bin
drwxr-xr-x 4 root root 3072 Aug 3 13:57 boot
drwxr-xr-x 11 root root 4060 Aug 3 14:02 dev
drwxr-xr-x 87 root root 12288 Aug 23 10:05 etc
drwxr-xr-x 3 root root 4096 Oct 1 2009 home
drwxr-xr-x 13 root root 12288 Jun 1 04:09 lib
drwx------ 2 root root 16384 Mar 24 2008 lost+found
drwxr-xr-x 3 root root 4096 Oct 1 2009 media
drwxr-xr-x 2 root root 0 Aug 3 14:02 misc
drwxr-xr-x 4 root root 4096 May 26 2012 mnt
drwxr-xr-x 2 root root 0 Aug 3 14:02 net
drwxr-xr-x 9 root root 4096 Jan 5 2009 nsr
drwxrwxr-x 3 root root 4096 Oct 12 2015 opt
dr-xr-xr-x 219 root root 0 Aug 3 14:01 proc
drwxr-x--- 12 root root 4096 Apr 22 10:06 root
drwxr-xr-x 2 root root 12288 Aug 4 04:02 sbin
drwxr-xr-x 2 root root 4096 Oct 1 2009 selinux
drwxr-xr-x 2 root root 4096 Oct 1 2009 srv
drwxr-xr-x 11 root root 0 Aug 3 14:01 sys
drwxrwxrwt 38 root root 4096 Aug 23 10:07 tmp
drwxr-xr-x 34 root root 4096 Jun 21 08:29 u
drwxr-xr-x 14 root root 4096 Apr 16 2010 usr
drwxr-xr-x 24 root root 4096 Apr 16 2010 var
-rw------- 1 root root 2865 Dec 16 2008 .viminfo
-bash-3.2$
EDIT:
Here is what I see after trying touch today in /home
So to try and create a new document in the root directory you need to be recognised as root. That means using the sudo command.
However for that you would need a password that you may not have. If you do perfect. But in any case I would not recommend adding files to the root directory.
Instead try the following:
cd home
touch today
This should work just fine and answer your question.
Still if you need/want to create today in your root directory try the following
sudo touch today
You will then be prompted for the root password that you can type (if you have it obviously)
In any case I suggest reading this which may be very helpful for you.
I wonder if this was ever truly answered.
If I was looking at it, I would try to see what the system thinks is the home directory of djaneka1, since it may have been setup partway and not completed, leaving stuff owned by root that should have been owned by djaneka1.
If you use the pwd command, and get back the "/" (root) directory there is something wrong with your setup.
The message: Could not chdir to home directory /u/d/j/djaneka1: No such file or directory
tells you it can't find your home directory.
-bash-3.2$ pwd
/
the command "pwd" revealing "/" is just an artifact of the system not being able to find your home directory.
To find what the system thinks is one's home directory,
one can search the file named '/etc/passwd' for one's login name.
I expect this is a possible result if you do that:
$ fgrep 'djaneka1' /etc/passwd
djaneka1:x:1505:1506::/u/d/j/djaneka1:/bin/bash
since it complained that it couldn't find that directory.
This needs to be fixed by someone who has more rights to the system, like root.
there is nothing djaneka1 can do a

Getting laravel to work with Apache 2

So I am new to Laravel.
I am using mac OS X to develop, so at first I thought it would be a great idea to use Homestead.
But they use nginx, which I barely know when I know a lot about apache2 having sys admin skills.
So tonight, I grabbed my dedicated server (which is much faster to download composer dependencies by the way), and I have this vhost:
paste.debian.net/130339/
ll /var/www/AMI
_> ➜ sites-enabled ll /var/www/AMI
total 100K
drwxrwxrwx 12 root root 4.0K Jun 1 20:16 app
-rwxrwxrwx 1 root root 2.4K Jun 1 20:16 artisan
drwxrwxrwx 2 root root 4.0K Nov 5 00:18 bootstrap
-rwxrwxrwx 1 root root 697 Jun 1 20:16 composer.json
-rwxrwxrwx 1 root root 58K Nov 5 00:18 composer.lock
-rwxrwxrwx 1 root root 146 Jun 1 20:16 CONTRIBUTING.md
-rwxrwxrwx 1 root root 567 Jun 1 20:16 phpunit.xml
drwxrwxrwx 3 root root 4.0K Jun 1 20:16 public
-rwxrwxrwx 1 root root 2.1K Jun 1 20:16 readme.md
-rwxrwxrwx 1 root root 519 Jun 1 20:16 server.php
drwxrwxrwx 20 root root 4.0K Nov 5 00:19 vendor
When you go http://ami.dubstep.it you see the laravel welcome page.
So after that, I created this route:
Route::get('/', function()
{
return View::make('hello');
});
Route::get('/about', function()
{
return View::make('hello');
});
But if you go to the previous url and add /about then you get 404.
Can anyone explain me ?
Error log of apache:
[Wed Nov 05 00:26:12 2014] [error] [client 23.226.237.192] File does not exist: /var/www/AMI/public/about
.htaccess in the public folder:
paste.debian.net/130340/
Please help ! (modrewrite is enable)
Have you done
composer dump-autoload
in the laravel directory?
Just some information on the command:
What are differences between "php artisan dump-autoload" and "composer dump-autoload"

linux permission group

I am trying to setup my webserver so that one group will have access to the files. Apache and every user that needs to edit the files will be part of this group. So I've set all the files to have the group psacln. I've added psacln to my groups. But it still won't let me view the files:
[tom#166 httpdocs]$ whoami
tom
[tom#166 httpdocs]$ groups tom
tom : tom adm wheel apache psacln andy
[tom#166 httpdocs]$ ls -al
ls: .: Permission denied
[tom#166 httpdocs]$ sudo ls -al
total 92
d---rwx--- 14 andy psacln 4096 Jul 22 17:51 .
drwxrwxr-x 16 apache apache 4096 Jul 21 09:29 ..
d---rwx--- 4 andy psacln 4096 Jul 21 09:26 backend
d---rwx--- 3 andy psacln 4096 Jul 22 15:21 core
d---rwx--- 5 andy psacln 4096 Jul 21 09:26 css
...
One thing that may be useful to note, is that when you change a user's group membership, you will have to log out and back in again (i.e. group memberships will take effect when you log in and don't normally change otherwise).
You can either log in and out to let the group change take effect, or changing your "active" group with the newgrp command will also do this for you.

Resources