LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-22-2018, 05:35 AM   #1
newbie14
Member
 
Registered: Sep 2011
Posts: 646

Rep: Reputation: Disabled
Correct method to setup Slim framework and setting url rewrite


Hi,
I am very new to slim framework and also my first time doing REST API. I tried both method as below.

composer create-project slim/slim-skeleton
composer create-project slim/slim.

I am on centos 7. For the second method I notice a lot of things need to be done on your own e.g. logging etc. My issue is that I dont know

1. Which method is correct one to be followed for both security and maitenance ?

2. My issue is that for example I have tried this link http://myip/apiv1/public/ . The moment I put e.g. http://myip/apiv1/public/test1. It fail to show up but when I put http://myip/apiv1/public/index.php/test1 this shows up. So I have been reading a lot of about url rewrite. I have tried settings in the apache config file the following line
Code:
<Directory "/var/www">
    AllowOverride All
    # Allow open access:
    Require all granted
    Options -Indexes
</Directory>
Code:
<Directory "/var/www/html">
    
   
    Options -Indexes -FollowSymLinks

    AllowOverride None

    Require all granted
</Directory>
I even tried the second one to AllowOverrride All but then everything stop working I revert to None. The issue is that what else am I missing here ?
 
Old 02-23-2018, 02:11 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Please clarify question #1 : Which method of what?

The installation default for DocumentRoot is "/var/www/html" -- is that what you have set?

Presuming then that your content is in /var/www/html/apiv1/public/test1 ?
You will need an index.htm(l) file in that directory, or you need to add index.php to the DirectoryIndex directive

The default http.conf has excellent built in documentation, but you need to understand what each directive actually does.
See the Apache documentation
 
Old 02-23-2018, 09:58 PM   #3
newbie14
Member
 
Registered: Sep 2011
Posts: 646

Original Poster
Rep: Reputation: Disabled
Hi,
Ok this are the two methods i am saying.

1. composer create-project slim/slim-skeleton
2. composer create-project slim/slim

So among the 2 above which is correct ?

I also have other applications running on my server.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Help] Rewrite URL failure in nginx - url end with #string ubungu Linux - Server 0 07-11-2013 07:44 AM
Method Not Allowed: The requested method POST is not allowed for the URL /writedhcp.p WiWa Linux - Networking 15 01-06-2011 01:20 PM
Rewrite URL path in reversed proxy setup ptemmerman Linux - Software 1 11-18-2008 06:53 AM
SlackWare :Method Not Allowed The requested method POST is not allowed for the URL slack31337 Linux - Software 0 04-08-2006 06:09 PM
Information on Input Method framework suveern Linux - General 0 11-22-2004 03:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration