Permission forbidden on localhost with apache2
I had the same problem , I edit the /etc/apache2/apache2.conf
file and add
<Directory /var/www/ >
Order allow,deny
Allow from all
Require all granted
</Directory>
and reset the apache2
sudo service apache2 restart
work for me .
Related videos on Youtube
Non
Updated on September 18, 2022Comments
-
Non over 1 year
I want to update/re-render the component after a new update comes up. All I am doing is:
I have a list of dealers for a casino game, what I want is to add a new dealer, and once the new dealer is added then display it in the view. It is actually happening, but in order for me to see the new dealer, I have to reload the page.
I am not updating the state, I am working with
this.props
. Look at my code@connectToStores export default class Dealers extends Component { constructor (props) { super(props); this.state = {} } componentWillMount () { GetDealersActions.getDealers(); } static getStores () { return [ GetDealersStore, CreateDealersStore ]; } static getPropsFromStores () { return { ...GetDealersStore.getState(), ...CreateDealersStore.getState(), } } render () { return ( <div> {!!this.props.dealerData ? this.props.dealerData.dealersData.map((dealer) => { return (here I am rendering what I need); : <p>Loading . . .</p> </div> } _addDealer = () => { CreateDealersActions.createDealer({ DealerName : this.refs.DealerName.getValue(), CardId : this.refs.CardId.getValue(), NickName : this.refs.NickName.getValue(), }); } }
as you see the component above in the code is doing the initial rendering properly, the problem comes up when you hit
_addDealer()
, which is not updating the component, you should reload the page in order to see the new item in the view.If you do a
console.log(this.props);
within_addDealer()
, you will get something like this{params: Object, query: Object, dealerData: Object, newDealerData: null}
where
dealerData
holds the full data of the dealers in the view but you can't see there the new dealer created. AndnewDealerData
remainsnull
so, what do you think I should do in order to update the component everytime a new prop/dealer comes up ? or how do I update the
props
? which is the proper method in this situation ?here is the full code for stores and actions just in case
action
@createActions(flux) class CreateDealersActions { constructor () { this.generateActions('createDealerSuccess', 'createDealerFail'); } createDealer (data) { const that = this; that.dispatch(); axios.post(`${API_ENDPOINT}/create-dealer/create-dealer`, data) .then(function success (data) { that.actions.createDealerSuccess({data}); }) } };
store
@createStore(flux) class CreateDealersStore { constructor () { this.state = { newDealerData : null, }; } @bind(CreateDealersActions.createDealerSuccess) createDealerSuccess (data) { this.setState({ newDealerData : data.response.config.data, }); } }
the Dealers component is within a tab named
management
, which is this one:const menuItems = [ { route : 'dealers', text : 'Dealers' }, { route : 'game-info', text : 'Game Info' }, { route : 'player-info', text : 'Players Info' }, { route : 'money', text : 'Money' } ]; export default class Management extends React.Component { static propTypes = { getActivePage : React.PropTypes.func, menuItems : React.PropTypes.arrayOf(React.PropTypes.object), } static contextTypes = { router : React.PropTypes.func, } render () { return ( <div> <TabsMainMenu menuItems={menuItems} getActivePage={this._getActivePage} /> <RouteHandler /> </div> ); } _getActivePage = () => { for (const i in menuItems) { if (this.context.router.isActive(menuItems[i].route)) return parseInt(i, 10); } } }